Bug #72038 [Asn->Csd]: Function calls with values to a by-ref parameter don't always throw a notice
| From: | bwoebi@php.net | Date: | Sat, 16 Apr 2016 18:36:41 +0000 |
| Subject: | Bug #72038 [Asn->Csd]: Function calls with values to a by-ref parameter don't always throw a notice | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-200601@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72038&edit=1
ID: 72038
Updated by: bwoebi@php.net
Reported by: bwoebi@php.net
Summary: Function calls with values to a by-ref parameter
don't always throw a notice
-Status: Assigned
+Status: Closed
Type: Bug
Package: Scripting Engine problem
Operating System: Irrelevant
PHP Version: master-Git-2016-04-16 (Git)
Assigned To: bwoebi
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=15d1d4f45bea8c7f9eedf0534ffee804640baaf1
Log: Fixed bug #72038 (Function calls with values to a by-ref parameter don't always throw a
notice)
Previous Comments:
------------------------------------------------------------------------
[2016-04-16 17:53:33] bwoebi@php.net
Description:
------------
The following works as expected (with the first parameter of test() accepting a reference) and
doesn't throw a notice:
test($foo = 2 /* anything not being an object */);
But objects omit that notice. Seems to be a PHP 4 relict, but today this should definitely emit a
notice.
Test script:
---------------
test($foo = new stdClass);
function test(&$param) {
$param = 1;
}
var_dump($foo);
Expected result:
----------------
Notice: Only variables should be passed by reference in - on line 5
object(stdClass)#1 (0) {
}
Actual result:
--------------
object(stdClass)#1 (0) {
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72038&edit=1