note 48317 added to language.oop5.iterations

From: Date: Sun, 19 Dec 2004 03:19:08 +0000
Subject: note 48317 added to language.oop5.iterations
Groups: php.notes 
Request: Send a blank email to php-notes+get-82008@lists.php.net to get a copy of this message
if you in a string define classes that implements IteratorAggregate. you cant use the default; <? ... public function getIterator() { return new MyIterator(\\$this-><What ever>); } .. ?> at least not if you want to use eval(<The string>). You have to use: <? ... public function getIterator() { \\$arrayObj=new ArrayObject(\\$this-><What ever>); return \\$arrayObj->getIterator(); } ... ?> ---- Manual Page -- http://www.php.net/manual/en/language.oop5.iterations.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+48317 Delete -- http://master.php.net/manage/user-notes.php?action=delete+48317&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48317&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48317&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48317&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48317&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48317&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+48317&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#82008) next »