Ejemplo n.º 1
0
<?php

class Simple
{
    var $x = 10;
    var $y = 10;
    function test()
    {
        return 20;
    }
    static function staticTest()
    {
        return 30;
    }
}
$simple = new Simple();
return $simple->test() + Simple::staticTest() + $simple->staticTest() + $simple->x + $simple->y === 100 ? 'success' : 'fail';
Ejemplo n.º 2
0
    }
}
class Simple
{
    function test()
    {
        static $i;
        $i++;
        return $i;
    }
}
test();
test();
Foo::test();
Foo::test();
Bar::test();
Bar::test();
$simple = new Simple();
$simple->test();
$simple->test();
static $one = 20, $two, $three = 40;
if ($one !== 20) {
    return 'fail_1';
}
if ($two !== null) {
    return 'fail_2';
}
if ($three !== 40) {
    return 'fail_3';
}
return test() + Foo::test() + Bar::test() + $simple->test() === 12 ? 'success' : 'fail';