3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $directory = new Directory('.'); $start_time = explode(" ", microtime()); $start_time = $start_time[1] + $start_time[0]; for ($i=1;$i<10000000;$i++) method_exists($directory,'read'); $end_time = explode(" ", microtime()); $end_time = $end_time[1] + $end_time[0]; echo '<br>method_exists time:' . ($end_time - $start_time); $start_time = explode(" ", microtime()); $start_time = $start_time[1] + $start_time[0]; $params = array($directory,'read'); for ($i=1;$i<10000000;$i++) is_callable(&$params); $end_time = explode(" ", microtime()); $end_time = $end_time[1] + $end_time[0]; echo '<br>is_callable time:' . ($end_time - $start_time); die; class A { static function b() { return 'soy b static'; } function a() { return 'soy a'; } } //$z=new a; //var_dump(is_callable($z::b())); $b=[new a, 'b']; var_dump(is_callable($b, false, $ret)); var_dump($ret); var_dump(get_defined_vars());
Output for 5.4.0 - 5.4.22
Fatal error: Call-time pass-by-reference has been removed in /in/1qFYJ on line 23
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Deprecated: Call-time pass-by-reference has been deprecated in /in/1qFYJ on line 23 Parse error: syntax error, unexpected '[' in /in/1qFYJ on line 50
Process exited with code 255.