Exemple #1
0
        }
    }
    echo "verifying static method works<br>\n";
    echo "Result: " . (airplane::fastest() == 'blackbird' ? 'pass' : 'fail') . "<br><br>\n\n";
}
function test5a()
{
    class tree
    {
        function type()
        {
            return 'oak';
        }
    }
    echo "verifying static method works when not defined with static keyword<br>\n";
    echo "Result: " . (tree::type() == 'oak' ? 'pass' : 'fail') . "<br><br>\n\n";
}
function test6()
{
    $s = new sibling('Jake');
    $s->add_sibling(new sibling('John'));
    $john_name = $s->get_first_sibling()->get_name();
    echo "verifying \$foo()->method_call() works<br>\n";
    echo "Result: " . ($john_name == 'John' ? 'pass' : 'fail') . "<br><br>\n\n";
}
function test7()
{
    class test7class
    {
        const NUM1 = 1;
        const NUM2 = 2;