|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-06-02 09:53 UTC] danack@php.net
-Status: Open
+Status: Not a bug
[2017-06-02 09:53 UTC] danack@php.net
[2017-06-02 10:02 UTC] nikic@php.net
[2017-06-02 10:07 UTC] contact at greg dot md
[2017-06-02 15:49 UTC] requinix@php.net
-Status: Not a bug
+Status: Verified
[2017-06-02 15:49 UTC] requinix@php.net
[2017-06-02 16:35 UTC] nikic@php.net
[2017-08-12 00:13 UTC] ajf@php.net
-Status: Verified
+Status: Wont fix
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 12:00:01 2025 UTC |
Description: ------------ When a namespace is defined in a file and you want to return a reference, the "PHP Notice: Only variables should be assigned by reference" is thrown. If I delete the namespace, then it works good. Test script: --------------- <?php namespace Bar; $foo = 'foo'; $bar = &call_user_func_array(function &() use (&$foo) { return $foo; }, []); $bar = 'bar'; echo $foo . PHP_EOL; Expected result: ---------------- bar Actual result: -------------- PHP Notice: Only variables should be assigned by reference in /htdocs/php-app/vendor/greg-md/php-framework/test.php on line 9 PHP Stack trace: PHP 1. {main}() /htdocs/php-app/vendor/greg-md/php-framework/test.php:0 Notice: Only variables should be assigned by reference in /htdocs/php-app/vendor/greg-md/php-framework/test.php on line 9 Call Stack: 0.0002 353152 1. {main}() /htdocs/php-app/vendor/greg-md/php-framework/test.php:0 foo