コード例 #1
0
ファイル: services9.php プロジェクト: Gregwar/symfony
    /**
     * Gets the 'baz' service.
     *
     * This service is shared.
     * This method always returns the same instance of the service.
     *
     * @return Baz A Baz instance.
     */
    protected function getBazService()
    {
        $this->services['baz'] = $instance = new \Baz();

        $instance->setFoo($this->get('foo_with_inline'));

        return $instance;
    }
コード例 #2
0
ファイル: constants.php プロジェクト: badlamer/hhvm
function main()
{
    $k = new Bar();
    $y = new Baz();
    foo();
    $k->asd();
    $y->k();
}
コード例 #3
0
ファイル: TestCase.php プロジェクト: leloulight/trigglog
 protected function eraseData()
 {
     Foo::truncate();
     Bar::truncate();
     Baz::truncate();
     Bom::truncate();
 }
コード例 #4
0
ファイル: implements.php プロジェクト: badlamer/hhvm
        use IterMethods;
        public static function hacklib_initialize_statics()
        {
            self::hacklib_initialize_statics_IterMethods();
        }
    }
    Foo::hacklib_initialize_statics();
    class Bar implements \HH\KeyedIterable, HH\Unrelated
    {
        use IterMethods;
        public static function hacklib_initialize_statics()
        {
            self::hacklib_initialize_statics_IterMethods();
        }
    }
    Bar::hacklib_initialize_statics();
}
namespace blah {
    class Baz implements \HH\KeyedIterable, \HH\Unrelated
    {
        use \IterMethods;
        public static function hacklib_initialize_statics()
        {
            self::hacklib_initialize_statics_IterMethods();
        }
    }
    Baz::hacklib_initialize_statics();
    testKeys(new \Foo());
    testKeys(new \Bar());
    testKeys(new Baz());
}
コード例 #5
0
ファイル: test.php プロジェクト: jpchristie/Scisr
<?php

/**
 * A simple test class
 */
class Baz
{
    function bar()
    {
    }
}
$f = new Baz();
$b = $f->bar();
コード例 #6
0
ファイル: lsb_018.php プロジェクト: badlamer/hhvm
    {
        var_dump($this);
    }
}
class Foo extends Singleton
{
}
class Bar extends Singleton
{
}
class Baz extends Bar
{
}
$u = Foo::getInstance();
$v = Bar::getInstance();
$w = Baz::getInstance();
$u->identify();
$v->identify();
$w->identify();
$x = Foo::getInstance();
$y = Bar::getInstance();
$z = Baz::getInstance();
$u->identify();
$v->identify();
$w->identify();
$x->identify();
$y->identify();
$z->identify();
?>
===DONE===
コード例 #7
0
ファイル: reflective_constant.php プロジェクト: badlamer/hhvm
<?php

class Foo
{
    public static function bar()
    {
        var_dump(Foo::class);
        var_dump(foo::class);
        var_dump(self::class);
        var_dump(Foo::CLASS);
        var_dump(foo::ClAsS);
        var_dump(seLF::CLass);
    }
}
class Baz extends Foo
{
    public function qux()
    {
        var_dump(parENT::CLAss);
        var_dump(staTIC::claSS);
    }
}
foo::bar();
$b = new Baz();
$b->qux();
コード例 #8
0
ファイル: test2.php プロジェクト: jpchristie/Scisr
<?php

/**
 * Another Foo file used for testing
 */
$b = Baz::bar();
コード例 #9
0
ファイル: tuples.php プロジェクト: badlamer/hhvm
    public function bar()
    {
        if (self::$d[0] + self::$d[1] + 1 === self::$e[0] + self::$e[1]) {
            echo "it's all good\n";
        }
        return $this->c;
    }
}
class Bar
{
    private $x = array("hey ", "don't make "), $y = array("jude ", "it bad ");
    private $z;
    public function __construct()
    {
        $this->z = array("", "", "");
        $this->z[0] = $this->x[0] . $this->y[0];
        $this->z[1] = $this->x[1] . $this->y[1];
        $this->z[2] = $this->z[0] . $this->z[1];
        echo $this->z[2] . "\n";
    }
}
class Baz extends Foo
{
}
$f = new Foo();
list($s, $i) = $f->bar();
echo $s . $i . "\n";
$g = new Baz();
list($s, $i) = $g->bar();
echo $s . $i . "\n";
new Bar();