Exemplo n.º 1
0
 function bmethod()
 {
     $this->aprop = "the current instance";
     aclass::aclass();
     aclass::amethod();
     // We want to disagree with PHP in this case.
     //  notparent::nmethod();
 }
Exemplo n.º 2
0
0001017	need static variables in class methods in interpreter

<?php 
class aclass
{
    function amethod()
    {
        static $foo;
        return $foo++;
    }
}
print aclass::amethod() . "\n";
print aclass::amethod() . "\n";
print aclass::amethod() . "\n";
$anobj = new aclass();
print $anobj->amethod() . "\n";
print $anobj->amethod() . "\n";
print $anobj->amethod() . "\n";