note 115590 added to language.references.whatdo

From: Date: Thu, 21 Aug 2014 02:39:21 +0000
Subject: note 115590 added to language.references.whatdo
Groups: php.notes 
Request: Send a blank email to php-notes+get-200234@lists.php.net to get a copy of this message
if variables are declared global before being called inside a foreach loop, then we can use any one of them to get the value of the loop; or when a values are being assigned to the first variable inside foreach, then calling the another variable to which it refers to will get the same value <?php global $ref,$row; $ref = 0; $row =& $ref; foreach(array(1,2,3) as $row) { echo $ref; } ?> output// 123; ---- Server IP: 103.241.147.77 Probable Submitter: 27.97.127.166 ---- Manual Page -- http://php.net/manual/en/language.references.whatdo.php Edit -- https://master.php.net/note/edit/115590 Del: integrated -- https://master.php.net/note/delete/115590/integrated Del: useless -- https://master.php.net/note/delete/115590/useless Del: bad code -- https://master.php.net/note/delete/115590/bad+code Del: spam -- https://master.php.net/note/delete/115590/spam Del: non-english -- https://master.php.net/note/delete/115590/non-english Del: in docs -- https://master.php.net/note/delete/115590/in+docs Del: other reasons-- https://master.php.net/note/delete/115590 Reject -- https://master.php.net/note/reject/115590 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#200234) next »