Exemplo n.º 1
0
<?php

$a = 3;
class A
{
    public function __construct()
    {
    }
    public function testA(B $b)
    {
        echo "You are testing the right thing..";
    }
}
class B
{
    public function __construct()
    {
    }
}
class C extends B
{
    public function __construct()
    {
    }
}
$d = new A();
$c = new C();
$d->testA($c);
Exemplo n.º 2
0
<?php

class A
{
    function nonStaticMethod()
    {
        echo "AAAAAAAAA";
    }
    function testA()
    {
        self::nonStaticMethod();
    }
}
$a = new A();
$a->testA();