|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2021-04-26 15:01 UTC] g dot sokol99 at g-sokol dot info
[2021-04-26 15:02 UTC] g dot sokol99 at g-sokol dot info
-Status: Open
+Status: Closed
[2021-04-26 15:02 UTC] g dot sokol99 at g-sokol dot info
[2021-04-26 15:50 UTC] cmb@php.net
-Status: Closed
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2021-04-26 15:50 UTC] cmb@php.net
[2021-04-27 12:03 UTC] cmb@php.net
-Type: Bug
+Type: Documentation Problem
[2021-04-27 12:03 UTC] cmb@php.net
[2021-04-27 12:03 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 07:00:01 2025 UTC |
Description: ------------ If we have some method that receives some arguments my reference, there is no way to invoke it with reflection. Test script: --------------- class TestReflectionMethodInvokeWithReferences { private static function testTarget(array &$a): void { $a['new_key'] = 'new value'; } } // Unit test use case $testReflectionMethodInvokeWithReferences = new ReflectionClass(TestReflectionMethodInvokeWithReferences::class); $target = $testReflectionMethodInvokeWithReferences->getMethod('testTarget'); $target->setAccessible(true); $arg = []; $target->invoke(null, &$arg); var_exoprt($arg); Expected result: ---------------- array ( 'new_key' => 'new value', ) Actual result: -------------- PHP Parse error: syntax error, unexpected token "&", expecting ")" in php shell code on line 5