note 84757 rejected from language.references.pass by danbrown

From: Date: Mon, 28 Jul 2008 21:12:01 +0000
Subject: note 84757 rejected from language.references.pass by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-142874@lists.php.net to get a copy of this message
Note Submitter: blische at kravis dot org ---- Considering this function with pass by reference parameter: function foo(&$p) { $p = 'new_' . $p; } I didn't think there was a difference between: $a = 'one'; foo($a); and foo($b = 'one'); print("a:[$a] b:[$b]"); Yet in PHP 5.2.6 I get: a:[new_one] b:[one] and this for PHP 4.4.0: a:[new_one] b:[new_one] Can someone explain why?

« previous php.notes (#142874) next »