|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-01-15 20:11 UTC] kolypto at mail dot ru
Description:
------------
I've noticed that the construction doesn't work fine with php 5.1.6 and 5.2.0
php4 is okay with this
The function reciaves value 'IN', prints it, and changes it to 'MOD'... but only in php4 =)
Spent hours catching this
Reproduce code:
---------------
function modify(&$str1)
{
print "\n".'In function:'.$str1;
$str1='MOD';
}
modify($a='IN');
print "\n".$a;
Expected result:
----------------
In function:IN
MOD
Actual result:
--------------
In function:IN
IN
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Feb 04 19:00:01 2026 UTC |
sigh. lets see.. function modify(&$str1) { print "\n".'In function:'.$str1; $str1='MOD'; } // the variable $a is locally **defined** with value "IN" modify($a='IN'); //this prints 'In function: IN' (as expected) print "\n".$a; // $a is **already defined** as 'IN', hence it SHOULD print 'IN' **not** MOD wth are you talking about ?? works as expected.