}
interface c extends a, b
{
    public function baz();
}
class d implements c
{
    public function foo($a)
    {
        if (!isset($a)) {
            return "foo";
        } else {
            return $a;
        }
    }
    public function bar()
    {
        return "bar";
    }
    public function baz()
    {
        return "baz";
    }
}
$d = new d();
echo $d->foo("tes");
echo "<br>";
echo $d->bar();
echo "<br>";
echo $d->baz();
echo "<br>";
Ejemplo n.º 2
0
<?php

// Test destruction order for SetS.
class d
{
    public static $x = "asd";
    public function __destruct()
    {
        d::$x = "destructor";
    }
    public static function foo()
    {
        $foo = new d();
        d::$x = $foo;
        unset($foo);
        echo "Foo: ";
        echo d::$x = "main";
        echo "\n";
        var_dump(d::$x);
    }
}
d::foo();