note 124846 added to function.func-get-arg
| From: | gordon at abetz-rouse dot com dot au | Date: | Mon, 23 Mar 2020 23:30:56 +0000 |
| Subject: | note 124846 added to function.func-get-arg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-214367@lists.php.net to get a copy of this message | ||
This function may work differently from php5 to php7, in the latter it seems to reference the
variable, while in php5 it returns the original argument.
I have confirmed with the versions below, but this will require further confirmation as to whether
this is a 5 versus 7 issue.
function test( $test ){
$test = '123';
echo func_get_arg(0);
}
test( '321' );
//in php 5.5.9, this script will write '321'
//in php 7.0.33, this script will write '123'
----
Server IP: 45.112.84.4
Probable Submitter: 38.142.137.34 (proxied: 119.17.129.186)
----
Manual Page -- http://php.net/manual/en/function.func-get-arg.php
Edit -- https://master.php.net/note/edit/124846
Del: integrated -- https://master.php.net/note/delete/124846/integrated
Del: useless -- https://master.php.net/note/delete/124846/useless
Del: bad code -- https://master.php.net/note/delete/124846/bad+code
Del: spam -- https://master.php.net/note/delete/124846/spam
Del: non-english -- https://master.php.net/note/delete/124846/non-english
Del: in docs -- https://master.php.net/note/delete/124846/in+docs
Del: other reasons-- https://master.php.net/note/delete/124846
Reject -- https://master.php.net/note/reject/124846
Search -- https://master.php.net/manage/user-notes.php