php create function

class Obj
{
public $test;

function cf()
{
$this->test = create_function( '', 'echo "Testing";' );
}
}

$o = new Obj;

$o->cf();

$o->{$test};

source

Leave a Reply