3v4l.org

run code in 300+ PHP versions simultaneously
<?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));

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.5.40.0100.07719.46
5.5.30.0070.04719.46
5.5.20.0030.04019.47
5.5.10.0000.04319.42
5.5.00.0070.03719.27
5.4.200.0200.06719.23
5.4.190.0000.08019.23
5.4.180.0030.04019.13
5.4.170.0030.03718.84
5.4.160.0000.04019.22
5.4.150.0070.03319.10
5.4.140.0000.03716.54
5.4.130.0070.03016.52
5.4.120.0070.03016.30
5.4.110.0000.04016.46
5.4.100.0030.03316.37
5.4.90.0000.03716.66
5.4.80.0000.04016.40
5.4.70.0000.03716.38
5.4.60.0000.03716.41
5.4.50.0030.03316.46
5.4.40.0000.03716.27
5.4.30.0000.03716.36
5.4.20.0070.03016.44
5.4.10.0000.05016.36
5.4.00.0000.03715.73
5.3.270.0000.04014.62
5.3.260.0030.03714.61
5.3.250.0000.04014.52
5.3.240.0100.03014.64
5.3.230.0100.03014.76
5.3.220.0070.03314.58
5.3.210.0030.03714.60
5.3.200.0000.03714.73
5.3.190.0000.04014.57
5.3.180.0070.03314.60
5.3.170.0070.03314.56
5.3.160.0070.03314.57
5.3.150.0130.02714.48
5.3.140.0000.04314.56
5.3.130.0000.04014.62
5.3.120.0030.03714.47
5.3.110.0000.04314.60
5.3.100.0070.03314.09
5.3.90.0030.03314.08
5.3.80.0070.03014.09
5.3.70.0000.04014.04
5.3.60.0000.03713.93
5.3.50.0070.03013.94
5.3.40.0100.03014.02
5.3.30.0000.03714.05
5.3.20.0070.03013.84
5.3.10.0070.03013.61
5.3.00.0070.03013.64

preferences:
132.49 ms | 1386 KiB | 7 Q