3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = function() { $p = 'abcde'; $c = 'abc'; var_export(substr($p, 0, strlen($c)) == $c, true); }; $s = microtime(1); for ($i =0; $i < 100; $i++) { $test(); } echo printf('%.2f', microtime(1) - $s);
Output for 5.3.0 - 5.3.2, 5.3.4 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.5, 5.5.7 - 5.5.24, 5.5.27 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0, 7.1.2, 7.1.4 - 7.1.6, 7.1.8 - 7.1.28, 7.1.30 - 7.1.33, 7.2.0 - 7.2.26, 7.3.0 - 7.3.2, 7.3.4 - 7.3.13, 7.4.0 - 7.4.1
0.004
Output for 5.3.3, 7.1.1, 7.3.3
0.054
Output for 5.5.26, 7.1.29
0.034
Output for 7.1.7
0.124
Output for 7.1.3
0.044
Output for 5.5.25
0.024
Output for 5.5.6
0.144
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/u9d9Z on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/u9d9Z on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/u9d9Z on line 3
Process exited with code 255.

preferences:
206.97 ms | 401 KiB | 325 Q