Re: PHP 5.3.1 reference parameter regression

From: Date: Fri, 18 Dec 2009 02:01:07 +0000
Subject: Re: PHP 5.3.1 reference parameter regression
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-46466@lists.php.net to get a copy of this message
Hi!
Yes, it works for me, in both the isolated test case and the original MW bug. MW's parser test suite shows 4 failing tests in 5.3.1, all fixed with this patch and no new regressions.
Great, will commit the patch tomorrow then to all branches.
The underlying functions are declared with reference parameters, and we call them with call_user_func_array() so explicitly creating references on the caller side is required. If you have a better method for calling arbitrary functions that accept reference parameters, let me know.
call_user_func_array() wasn't a problem in this particular case, __call was (see the bug), because internally it's user function call simulated by internal function call, so it needed some special check.
Lots of MediaWiki functions are declared with reference parameters for objects when they aren't really needed, because that was the required
Entirely unrelated to this bug, passing objects by-ref is not the best idea in PHP 5. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#46466) next »