-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
func_get_args() call order fix for HHVM bug #1142
Conversation
Hello, thank you for creating this pull request. However did not open it on the "master" Please open the pull request again for the "master" branch and close Nevertheless I have opened a Jira ticket for this Pull Request to track this http://www.doctrine-project.org/jira/browse/DDC-3317 We use Jira to track the state of pull requests and the versions they got |
Related: facebook/hhvm#3816 |
@TwoWholeWorms can you also check if this affects |
By the looks of it, it's already been fixed in all these functions in master (which I'd guess is the 2.5.*-dev tree), so I think the 2.4-only fix should suffice. I could back-port it further, but I highly doubt anyone is using anything earlier than 2.4 on HHVM. Actually, TBH, I highly doubt anyone is using 2.4 on HHVM at all, since it's, y'know… b0rked. |
Ok, fine with merging then. I'll also tag. |
func_get_args() call order fix for HHVM bug
@Ocramius @TwoWholeWorms — Doesn't look like this fixes much? A test case would have been nice. |
ProxyQuery test failed because of bug doctrine/orm#1142
ProxyQuery test failed because of bug doctrine/orm#1142
Firstly, so no-one closes this as ENOTONMASTER, @Ocramius told me to open it directly against 2.4. :)
This PR fixes bugs in
Doctrine\ORM\QueryBuilder
where the values provided to method arguments to::andWhere()
,::orWhere()
,::andHaving()
, and::orHaving()
are overwritten by code within the methods in HHVM and PHP7.After much fun and headscratching in both #doctrine and #hhvm on Freenode, we discovered that in the following code,
$where = $this->getDqlPart('where');
overwrites the values stored internally for the$where
parameter of the function which is returned byfunc_get_args()
:This means that instead of
$args
being set as expected to an array containing the string or object provided to the function, it actually contains the object returned byQueryBuilder::getDqlPart()
, which causes all the problems you'd expect it to.This PR simply swaps the order of the calls so that the function arguments are retrieved via
func_get_args()
before the$where
variable is modified, fixing the problem.