3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a { static public function o() { return true;} } $cls = [ '' ]; foreach($cls as $cl) { echo var_export($cl, true); echo "\t"; echo "is_callable\n"; var_dump(is_callable($cl)); echo "is_callable by syntax\n"; var_dump(is_callable($cl,true)); echo "instance of closure\n"; var_dump($cl instanceof Closure); }

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
'' is_callable bool(false) is_callable by syntax bool(true) instance of closure bool(false)
Output for Arrow functions
'' is_callable bool(false) is_callable by syntax bool(true) instance of closure bool(false)
Output for Object typehint
'' is_callable bool(false) is_callable by syntax bool(true) instance of closure bool(false)
Output for Array change keys
'' is_callable bool(false) is_callable by syntax bool(true) instance of closure bool(false)
Output for Lexical anon
'' is_callable bool(false) is_callable by syntax bool(true) instance of closure bool(false)

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page