3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private function foo() { echo 'foo'; } public function bar(callable $call) { $call(); } } $a = new A; // A::foo is not callable here, but will be when we get inside A::bar var_dump(is_callable([$a, 'foo'] )); $a->bar( [$a, 'foo'] );

preferences:
36.55 ms | 405 KiB | 5 Q