New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed new instance creating for php 5.4+ #1053
Conversation
Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DDC-3158 We use Jira to track the state of pull requests and the versions they got |
+1 The original error was :
|
We already had some bugs introduced by this hotfix (see #1051), so this needs more testing before it lands. |
@nkt yes, and I'm saying that using |
Rather than testing for version, you should test for the method itself as mentioned here : #1056 (comment) |
OMG people, at least fifth PR with same change? |
Please read the discussion on 530c01b and you will see why we want to change the Doctrine behavior only on affected PHP version rather than on all PHP 5.4+. this change is breaking other stuff |
@stof I don't really understand how this code could broke something? $this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name)) No one promised that this code will works fine in future, and now it's broken. This method should return new instance without calling costructor, so it's doing it. |
It was a hack, and a well known one as well. It was used everywhere we needed to do this, and So yes, the hack is still more reliable than the official solution. |
@Ocramius why it should break something, this is spited method, it's could working whatever it's want, but must return new instance of given class. |
Here: http://3v4l.org/gGf7X |
@Ocramius thanks. Now I see. |
@nkt it was already released |
@Ocramius 👍 |
there is already a discussion about this on php-internals |
No description provided.