note 84757 added to language.references.pass

From: Date: Mon, 28 Jul 2008 21:10:28 +0000
Subject: note 84757 added to language.references.pass
Groups: php.notes 
Request: Send a blank email to php-notes+get-142873@lists.php.net to get a copy of this message
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? ---- Server IP: 217.160.250.20 Probable Submitter: 209.60.178.4 ---- Manual Page -- http://www.php.net/manual/en/language.references.pass.php Edit -- https://master.php.net/note/edit/84757 Del: integrated -- https://master.php.net/note/delete/84757/integrated Del: useless -- https://master.php.net/note/delete/84757/useless Del: bad code -- https://master.php.net/note/delete/84757/bad+code Del: spam -- https://master.php.net/note/delete/84757/spam Del: non-english -- https://master.php.net/note/delete/84757/non-english Del: in docs -- https://master.php.net/note/delete/84757/in+docs Del: other reasons-- https://master.php.net/note/delete/84757 Reject -- https://master.php.net/note/reject/84757 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#142873) next »