Bug #71113 [Opn]: Problems with func_get_args

From: Date: Mon, 14 Dec 2015 09:11:27 +0000
Subject: Bug #71113 [Opn]: Problems with func_get_args
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-12935@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71113&edit=1 ID: 71113 Updated by: laruence@php.net Reported by: kogleron at gmail dot com Summary: Problems with func_get_args Status: Open Type: Bug -Package: *Programming Data Structures +Package: Documentation problem Operating System: OS X 10.11.1 PHP Version: 7.0.0 Block user comment: N Private report: N New Comment: this has been documented in https://github.com/php/php-src/blob/PHP-7.0.0/UPGRADING#L190 maybe the document should be updated thanks Previous Comments: ------------------------------------------------------------------------ [2015-12-14 08:19:22] kogleron at gmail dot com Description: ------------ Possibility to modify results from func_get_args() inside a function. Test script: --------------- <?php function foo($params){ print_r(['Before' => func_get_args()]); $params['from_foo1'] = 2; print_r(['After' => func_get_args()]); } foo(['from_global' => 1]); Expected result: ---------------- Array ( [Before] => Array ( [0] => Array ( [from_global] => 1 ) ) ) Array ( [After] => Array ( [0] => Array ( [from_global] => 1 ) ) ) Actual result: -------------- Array ( [Before] => Array ( [0] => Array ( [from_global] => 1 ) ) ) Array ( [After] => Array ( [0] => Array ( [from_global] => 1 [from_foo1] => 2 ) ) ) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71113&edit=1

« previous php.doc.bugs (#12935) next »