- var_dump: documentation ( source)
<?php
class Foo
{
public $c;
public function __construct(callable $c)
{
$this->c = $c;
}
public function doCb()
{
($this->c)();
}
private static function bar()
{
var_dump(__METHOD__);
}
}
$f = new Foo('Foo::bar');
// fine
$f->doCb();
// not fine
($f->c)();