3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C{ public $foo; public function __construct() { $this->foo = array($this, 'foo'); } public function foo(){echo "foo is evidently a callable function!";} } $o=new C(); if(is_int($o->foo)){ echo "foo is an integer!\n"; } if(is_callable($o->foo)){ echo "foo IS callable!\n"; }else{ echo "foo IS NOT callable!\n"; } $o->foo();

preferences:
33.2 ms | 404 KiB | 5 Q