On 29-07-2010 at 20:47:05 Klederson Bueno <kleder...@klederson.com> wrote:

Tks for everything, now up and running:

class BurnModelIterator implements Iterator
{
    protected $obj, $current;

    public function __construct(PhpBURN_Core $obj) {
        $this->obj = &$obj;

You shouldn't use &$obj in PHP5. $this->obj = $obj; does the right thing.

    function current() {
        return $this->current = $this->obj;
    }

This looks suspicious - current() shouldn't change anything, and only return currently loaded element.

If $obj is a weird object that changes its own identity on fetch(), then don't need to keep $this->current, and can simply return $this->obj.

--
regards, Kornel

_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to