note 76727 added to language.references.pass

From: Date: Fri, 27 Jul 2007 20:06:18 +0000
Subject: note 76727 added to language.references.pass
Groups: php.notes 
Request: Send a blank email to php-notes+get-128995@lists.php.net to get a copy of this message
Just another workaround for default values to parameters by ref in response to mogmios, bobbykjack, andrzej, fdelizy, petruzanautico, Train Boy, and php community. <?php # php 4.3.10 # note there's no & in function declaration: function f($a = array('default value')) { $a[0] .= " processed<br/>"; echo $a[0]; } f(); # default value processed $b = 'foo'; f(array(&$b)); # foo processed (note the & here) echo $b; # foo processed ?> ---- Server IP: 69.147.83.197 Probable Submitter: 201.26.211.13 ---- Manual Page -- http://www.php.net/manual/en/language.references.pass.php Edit -- https://master.php.net/note/edit/76727 Del: integrated -- https://master.php.net/note/delete/76727/integrated Del: useless -- https://master.php.net/note/delete/76727/useless Del: bad code -- https://master.php.net/note/delete/76727/bad+code Del: spam -- https://master.php.net/note/delete/76727/spam Del: non-english -- https://master.php.net/note/delete/76727/non-english Del: in docs -- https://master.php.net/note/delete/76727/in+docs Del: other reasons-- https://master.php.net/note/delete/76727 Reject -- https://master.php.net/note/reject/76727 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#128995) next »