3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $test = function($p = 'abcde', $c = 'abc') { return substr($p, 0, strlen($c)) == $c, true); }; $test1 = function($p = 'abcde', $c = 'abc') { return strncmp($p, $c, strlen($c)); }; $print = function($closure, $s, $cycles = 100) { for ($i =0; $i < $cycles; $i++) { $closure(); } echo printf('Runns: %s', microtime(1) - $s); echo PHP_EOL; }; $print($test, microtime(1)); $print($test1, microtime(1));
Output for 5.3.0 - 5.5.4
Parse error: syntax error, unexpected ',' in /in/79ijj on line 5
Process exited with code 255.