<?php
class Foo {
static $i = 5;
private $p = 5;
function bar() {
echo self::$i . ". ($this->p) Foo->bar() called\n";
self::$i--;
$this->p--;
if (!self::$i) return false;
return true;
}
}
function myFoo() {
return new Foo();
}
while ($foo = myFoo()->bar()) {}
?>