3v4l.org

run code in 300+ PHP versions simultaneously
<?php function probe($label, $times, $callback) { $mem = memory_get_usage(); $start = microtime(true); $array = $callback($times); $time = microtime(true) - $start; $mem = sprintf('%.3f', (memory_get_usage() - $mem) / 1024 / 1024); return "$label: $time s, $mem MB"; } $times = 100000; $run1 = probe('String key', $times, function ($times) { $a = []; while ($times-- > 0) { $a["pagemanagement" . "#" . "staticblocktype" . "#" . $times . "#" . 1] = "test " . $times; } return $a; }); $run2 = probe('CRC32 key', $times, function ($times) { $a = []; while ($times-- > 0) { $a[crc32("pagemanagement" . "#" . "staticblocktype" . "#" . $times . "#" . 1)] = "test " . $times; } return $a; }); $run3 = probe('MD5 key', $times, function ($times) { $a = []; while ($times-- > 0) { $a[md5("pagemanagement" . "#" . "staticblocktype" . "#" . $times . "#" . 1)] = "test " . $times; } return $a; }); $run4 = probe('SHA1 key', $times, function ($times) { $a = []; while ($times-- > 0) { $a[sha1("pagemanagement" . "#" . "staticblocktype" . "#" . $times . "#" . 1)] = "test " . $times; } return $a; }); echo join("<br/>\n", [ $run1, $run2, $run3, $run4, ]);

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)
7.3.00.0500.21238.35
7.2.130.0370.21938.72
7.2.120.0630.23738.89
7.2.110.0690.24138.96
7.2.100.0460.22338.84
7.2.90.0430.23338.96
7.2.80.0460.23538.65
7.2.70.0560.23039.02
7.2.60.0730.21138.95
7.2.50.0570.22738.83
7.2.40.0580.22438.89
7.2.30.0860.22938.59
7.2.20.0620.22638.55
7.2.10.0620.22738.79
7.2.00.0430.23038.48
7.1.250.0760.31937.72
7.1.240.0430.26737.80
7.1.230.0370.27637.64
7.1.220.0590.28437.71
7.1.210.0560.29337.84
7.1.200.0460.25437.97
7.1.190.0560.23937.75
7.1.180.0530.25937.68
7.1.170.0530.24137.73
7.1.160.0430.25737.73
7.1.150.0590.28137.69
7.1.140.0700.23737.66
7.1.130.0630.29237.68
7.1.120.0510.22937.76
7.1.110.0810.24037.96
7.1.100.0570.26737.63
7.1.90.0580.27637.56
7.1.80.0630.24637.78
7.1.70.0350.19738.41
7.1.60.0470.21538.64
7.1.50.0270.23338.39
7.1.40.0570.25337.81
7.1.30.0540.24637.64
7.1.20.0640.24637.74
7.1.10.0760.26337.50
7.1.00.0400.28040.96
7.0.330.0430.29837.16
7.0.320.0760.32737.53
7.0.310.0590.25737.43
7.0.300.0620.23337.27
7.0.290.0600.26837.45
7.0.280.0660.24337.17
7.0.270.0700.27937.33
7.0.260.0750.24937.09
7.0.250.0390.24437.68
7.0.240.0820.24937.43
7.0.230.0650.25537.64
7.0.220.0580.24137.61
7.0.210.0650.23837.27
7.0.200.4750.23436.80
7.0.190.0670.21737.62
7.0.180.0720.24537.59
7.0.170.0460.26337.73
7.0.160.0440.24037.64
7.0.150.0760.24437.45
7.0.140.0640.24637.63
7.0.130.0650.24437.54
7.0.120.0610.24737.33
7.0.110.0750.25137.39
7.0.100.0820.26737.39
7.0.90.0760.26737.54
7.0.80.0800.23737.48
7.0.70.0920.26337.43
7.0.60.0360.25740.64
7.0.50.0480.25638.13
7.0.40.0600.28530.53
7.0.30.0780.33130.38
7.0.20.0750.29030.50
7.0.10.0580.28830.50
7.0.00.1020.28030.48
5.6.380.0300.67436.99
5.6.370.0270.52536.74
5.6.360.0240.51637.18
5.6.350.0200.56837.13
5.6.340.0460.55436.97
5.6.330.0330.58136.89
5.6.320.0330.51436.78
5.6.310.0130.52536.93
5.6.300.0380.51837.08
5.6.290.0230.57136.90
5.6.280.0240.47739.98
5.6.270.0290.60136.94
5.6.260.0170.59136.70
5.6.250.0200.59136.95
5.6.240.0240.59436.63
5.6.230.0330.59936.95
5.6.220.0290.59537.09
5.6.210.0650.47239.54
5.6.200.0250.50038.51
5.6.190.0410.60739.74
5.6.180.0380.64439.80
5.6.170.0580.63339.72
5.6.160.0570.54239.71
5.6.150.0640.54739.65
5.6.140.0430.54739.81
5.6.130.0600.58539.65
5.6.120.0310.57439.81
5.6.110.0470.54239.79
5.6.100.0270.54639.73
5.6.90.0330.63339.91
5.6.80.0710.57239.38
5.6.70.0480.53239.42
5.6.60.0300.54239.39
5.6.50.0370.55539.25
5.6.40.0420.56739.29
5.6.30.0350.55139.21
5.6.20.0440.54239.34
5.6.10.0350.54239.27
5.6.00.0380.51739.33
5.5.380.0130.57833.59
5.5.370.0100.58733.75
5.5.360.0160.60833.76
5.5.350.1810.44638.30
5.5.340.0170.47037.00
5.5.330.0410.59038.15
5.5.320.0300.59837.81
5.5.310.0290.57538.18
5.5.300.0390.56637.97
5.5.290.0350.54838.16
5.5.280.0320.56337.76
5.5.270.0400.58238.14
5.5.260.0360.57637.66
5.5.250.0330.62037.97
5.5.240.0520.55437.73
5.5.230.0350.58937.64
5.5.220.0450.53837.76
5.5.210.0300.52537.82
5.5.200.0400.55837.68
5.5.190.0410.53137.76
5.5.180.0330.54037.79
5.5.170.0100.49033.57
5.5.160.0320.52237.81
5.5.150.0280.58637.76
5.5.140.0300.53837.80
5.5.130.0270.56937.72
5.5.120.0430.54837.67
5.5.110.0320.54937.66
5.5.100.0320.57537.57
5.5.90.0280.54337.61
5.5.80.0300.53237.60
5.5.70.0340.50937.77
5.5.60.0270.53737.59
5.5.50.0250.55537.57
5.5.40.0200.56237.73
5.5.30.0320.58837.71
5.5.20.0430.54837.55
5.5.10.0420.54537.63
5.5.00.0420.58137.48

preferences:
27.82 ms | 403 KiB | 5 Q