[ create a new paste ] login | about

Link: http://codepad.org/QlgoTaew    [ raw code | output | fork ]

gnel - PHP, pasted on Nov 13:
<?php
class A
{

    public $var;
    public static function printHi()
    {

        echo "Hello";   

    }

    public function __construct($string)
    {
        $this->var = $string;   


    }

    public function foo()
    {

        call_user_func($this->var); 

    }

}

$a = new A('A::printHi');
$a->foo();

?>


Output:
1
Hello


Create a new paste based on this one


Comments: