note 24853 deleted from control-structures.foreach by philip

From: Date: Mon, 30 Dec 2002 17:44:56 +0000
Subject: note 24853 deleted from control-structures.foreach by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-41478@lists.php.net to get a copy of this message
It seams that foreach() DOES move the array pointer! <?php $a = array(1,2,3,4); foreach($a as $var) print $var; print current($a); ?> current() prints nothing in php 4.2.2 where it should print 1. comment out the foreach() line and current() prints 1. dunno how other php versions handle this

« previous php.notes (#41478) next »