3v4l.org

run code in 300+ PHP versions simultaneously
<?php function micro_parse($a) { $parts = explode(' ', $a); return [ (int)$parts[1], (int)substr($parts[0], 2, 6) ]; } function micro_diff($a, $b) { return [ $b[0] - $a[0], $b[1] - $a[1] ]; } function micro_fmt($a) { return sprintf('%d.%06d', $a[0], $a[1]); } $str = 'foobar'; $iter = 100000; $algos = ['md5', 'fnv1a32', 'fnv1a64']; foreach($algos as $algo) { $start = microtime(); for( $i=0; $i<$iter; $i++ ) { $h = hash($algo, $str); } $end = microtime(); printf("%8s: %s\n", $algo, micro_fmt(micro_diff(micro_parse($start), micro_parse($end)))); }

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.120.0000.09014.97
7.3.110.0070.07315.00
7.3.100.0130.06114.93
7.3.90.0000.08214.81
7.3.80.0030.07414.88
7.3.70.0100.07715.01
7.3.60.0030.08014.97
7.3.50.0070.07414.80
7.3.40.0030.07014.86
7.3.30.0000.07614.95
7.3.20.0060.07516.73
7.3.10.0070.07316.43
7.3.00.0070.07716.85
7.2.240.0030.07715.33
7.2.230.0030.07815.21
7.2.220.0070.08115.41
7.2.210.0070.07715.07
7.2.200.0000.08415.35
7.2.190.0030.07715.02
7.2.180.0030.08714.89
7.2.170.0000.07515.22
7.2.160.0070.06814.93
7.2.150.0100.06917.02
7.2.140.0070.08116.86
7.2.130.0100.07017.04
7.2.120.0060.07116.95
7.2.110.0100.06916.97
7.2.100.0030.07616.95
7.2.90.0510.07515.88
7.2.80.0520.06915.86
7.2.70.0400.07516.00
7.2.60.0580.07615.95
7.2.50.0440.08716.08
7.2.40.0640.07016.15
7.2.30.0480.07116.11
7.2.20.0360.07216.17
7.2.10.0380.07816.09
7.2.00.0430.07716.12
7.1.330.0070.08815.80
7.1.320.0100.08915.80
7.1.310.0030.09015.93
7.1.300.0130.09115.84
7.1.290.0030.10015.85
7.1.280.0030.08815.75
7.1.270.0030.09415.79
7.1.260.0100.09515.89
7.1.250.0100.08515.79
7.1.210.1620.06713.77
7.1.200.0810.11413.75
7.1.190.0750.07213.71
7.1.180.0800.07413.67
7.1.170.0720.07213.61
7.1.160.0880.06513.88
7.1.150.0710.07213.65
7.1.140.0910.06814.15
7.1.130.0620.06213.97
7.1.120.0690.06613.91
7.1.110.0720.07213.65
7.1.100.0660.06614.05
7.1.90.0830.11313.71
7.1.80.0750.06913.93
7.1.70.0710.06413.96
7.1.60.1030.11231.81
7.1.50.1070.10631.81
7.1.40.1180.06931.64
7.1.30.1170.07131.83
7.1.20.1320.09331.59
7.1.10.0070.12714.02
7.1.00.1100.06513.80

preferences:
38.85 ms | 401 KiB | 5 Q