note 49518 deleted from language.oop5.iterations by nlopess

From: Date: Mon, 31 Jan 2005 20:04:33 +0000
Subject: note 49518 deleted from language.oop5.iterations by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-84285@lists.php.net to get a copy of this message
Note Submitter: Tim Reason: bad code ---- For the example of implementing Iterator, the function defined for valid() is slightly incorrect. It is defined as <?php public function valid() { $var = $this->current() !== false; echo "valid: {$var}\n"; return $var; }?> But it should be defined as <?php public function valid() { $var = current($this->var) !== false; echo "valid: {$var}\n"; return $var; }?>

« previous php.notes (#84285) next »