3v4l.org

run code in 300+ PHP versions simultaneously
<?php printf("PHP_VERSION=%s\n",PHP_VERSION); $min = -(mt_getrandmax()>>1); $max = mt_getrandmax(); $count = isset($argv[1])?(int)$argv[1]:16; printf("min=%d, max=%d, count=%d\n",$min,$max,$count); $repeat_counts = array(); for ($i=0;$i<$count;$i++) { $random = mt_rand($min,$max); if (!isset($repeat_counts[$random])) { $repeat_counts[$random] = 0; } $repeat_counts[$random]++; //printf("%12d%s\n", abs($random),($random<0)?"-":""); } $max_repeat_count = max($repeat_counts); $same_value_max = array(); if ($max_repeat_count > 1) { foreach ($repeat_counts as $value => $repeat_count) { if ($repeat_count >= $max_repeat_count) { $same_value_max[] = $value; } } printf("The following number/s was/were repeated %d times (%s%%): %s\n" ,$max_repeat_count ,number_format(($max_repeat_count/$count)*100.0,1) ,implode(", ",$same_value_max) ); }

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.4.00.0070.01015.18
7.3.120.0050.01115.00
7.3.110.0080.00914.85
7.3.100.0100.00614.84
7.3.90.0030.01314.89
7.3.80.0070.00414.82
7.3.70.0100.00515.01
7.3.60.0010.00914.78
7.3.50.0060.00814.81
7.3.40.0040.00814.87
7.3.30.0040.00614.65
7.3.20.0050.00916.73
7.3.10.0050.00916.60
7.3.00.0040.00816.56
7.2.250.0100.01015.00
7.2.240.0120.00715.02
7.2.230.0080.00915.17
7.2.220.0000.01415.15
7.2.210.0060.00814.95
7.2.200.0070.01215.07
7.2.190.0040.00915.10
7.2.180.0000.01015.21
7.2.170.0050.00515.00
7.2.160.0030.00714.95
7.2.150.0030.00717.09
7.2.140.0080.00816.79
7.2.130.0030.01116.86
7.2.120.0070.00716.89
7.2.110.0070.00916.68
7.2.100.0030.01216.82
7.2.90.0050.00917.07
7.2.80.0100.00516.79
7.2.70.0070.00716.82
7.2.60.0060.00616.98
7.2.50.0080.00616.94
7.2.40.0090.00216.88
7.2.30.0050.00516.87
7.2.20.0090.00816.86
7.2.10.0050.00816.83
7.2.00.0070.00817.82
7.1.330.0050.01015.87
7.1.320.0070.00815.80
7.1.310.0060.00615.86
7.1.300.0030.01215.83
7.1.290.0040.00815.71
7.1.280.0080.00515.88
7.1.270.0030.00815.77
7.1.260.0070.00415.69
7.1.250.0020.00915.89
7.1.100.0120.01616.36
7.1.70.0090.00617.02
7.1.60.0040.00716.91
7.1.50.0070.01017.14
7.1.00.0070.07022.30
7.0.200.0030.01316.69
7.0.140.0170.06321.92
7.0.110.0100.08020.01
7.0.100.0170.07719.96
7.0.90.0070.04719.88
7.0.80.0030.08319.93
7.0.70.0200.06719.87
7.0.60.0030.06720.04
7.0.50.0170.07720.06
7.0.40.0070.04319.77
7.0.30.0070.04719.85
7.0.20.0130.03319.71
7.0.10.0070.04319.64
7.0.00.0030.05019.82
5.6.280.0100.06720.93
5.6.260.0030.07720.54
5.6.250.0170.07020.52
5.6.240.0130.04320.60
5.6.230.0000.05720.69
5.6.220.0130.07720.41
5.6.210.0030.06020.77
5.6.200.0100.07320.60
5.6.190.0170.07720.65
5.6.180.0100.06720.59
5.6.170.0030.04320.62
5.6.160.0070.03720.69
5.6.150.0030.08320.59
5.6.140.0030.05020.55
5.6.130.0070.03720.59
5.6.120.0030.03720.61
5.6.110.0070.03720.54
5.6.100.0030.07320.41
5.6.90.0030.08020.58
5.6.80.0000.04319.98
5.6.70.0030.04020.18
5.6.60.0000.04319.88
5.6.50.0130.05319.97
5.6.40.0070.06720.00
5.6.30.0100.05719.89
5.6.20.0070.06719.86
5.6.10.0100.06319.88
5.6.00.0000.04020.00
5.5.380.0100.06017.64
5.5.370.0170.06017.64
5.5.360.0000.06317.62
5.5.350.0130.06317.46
5.5.340.0000.04718.10
5.5.330.0030.08317.99
5.5.320.0030.04018.17
5.5.310.0070.05717.89
5.5.300.0070.04717.85
5.5.290.0000.04718.02
5.5.280.0000.05718.12
5.5.270.0100.04017.85
5.5.260.0030.04718.16
5.5.250.0070.05717.71
5.5.240.0100.04317.23
5.5.230.0070.03717.38
5.5.220.0030.06317.53
5.5.210.0070.04017.24
5.5.200.0030.07017.37
5.5.190.0000.08317.38
5.5.180.0070.07717.51
5.5.160.0170.06317.52
5.5.150.0070.05317.20
5.5.140.0000.04317.59
5.5.130.0130.05717.37
5.5.120.0100.06017.59
5.5.110.0000.08017.37
5.5.100.0170.06017.36
5.5.90.0030.06017.02
5.5.80.0030.07717.14
5.5.70.0070.03017.40
5.5.60.0030.03717.10
5.5.50.0030.05017.25
5.5.40.0030.04017.01
5.5.30.0130.04017.02
5.5.20.0100.03317.24
5.5.10.0030.04017.40
5.5.00.0000.05317.48
5.4.450.0030.03719.31
5.4.440.0000.05019.48
5.4.430.0070.03319.35
5.4.420.0000.04319.59
5.4.410.0030.04019.30
5.4.400.0030.05019.18
5.4.390.0030.05019.07
5.4.380.0030.05719.12
5.4.370.0100.06319.09
5.4.360.0100.08319.18
5.4.350.0070.06318.93
5.4.340.0030.03319.16
5.4.320.0130.05319.25
5.4.310.0070.03319.12
5.4.300.0030.06019.11
5.4.290.0070.04019.00
5.4.280.0070.06719.07
5.4.270.0070.04319.16
5.4.260.0000.08019.17
5.4.250.0100.04318.90
5.4.240.0000.03718.92
5.4.230.0000.03718.92
5.4.220.0100.03718.94
5.4.210.0000.04319.24
5.4.200.0000.04318.94
5.4.190.0030.05019.11
5.4.180.0100.03319.02
5.4.170.0000.04319.02
5.4.160.0070.03719.25
5.4.150.0030.04018.98
5.4.140.0000.04016.23
5.4.130.0000.03316.50
5.4.120.0030.03016.51
5.4.110.0000.07016.13
5.4.100.0100.04716.23
5.4.90.0000.07716.14
5.4.80.0030.07316.34
5.4.70.0000.06716.39
5.4.60.0070.07316.06
5.4.50.0000.05716.26
5.4.40.0070.03016.26
5.4.30.0030.04316.49
5.4.20.0030.07016.25
5.4.10.0030.06316.34
5.4.00.0030.07315.99
5.3.290.0070.06014.54
5.3.280.0000.03714.61
5.3.270.0030.04014.50
5.3.260.0000.04314.67
5.3.250.0000.03314.48
5.3.240.0030.03014.52
5.3.230.0070.07314.53
5.3.220.0100.02714.58
5.3.210.0070.07014.42
5.3.200.0000.06714.60
5.3.190.0030.03314.67
5.3.180.0030.06314.50
5.3.170.0030.07014.45
5.3.160.0070.07714.50
5.3.150.0200.04714.42
5.3.140.0000.03314.40
5.3.130.0070.05014.50
5.3.120.0070.07014.62
5.3.110.0000.07014.44
5.3.100.0070.06713.96
5.3.90.0070.07313.96
5.3.80.0070.04013.91
5.3.70.0170.05313.95
5.3.60.0000.05013.89
5.3.50.0030.04013.82
5.3.40.0030.04313.90
5.3.30.0070.03713.84
5.3.20.0030.03313.56
5.3.10.0000.04313.45
5.3.00.0070.03713.57
5.2.170.0030.05312.09
5.2.160.0070.05712.09
5.2.150.0000.05312.09
5.2.140.0030.04012.09
5.2.130.0030.02712.09
5.2.120.0070.02712.09
5.2.110.0000.03012.09
5.2.100.0000.03312.09
5.2.90.0030.03012.09
5.2.80.0030.03012.09
5.2.70.0030.03012.09
5.2.60.0030.02712.09
5.2.50.0000.03012.09
5.2.40.0030.02712.09
5.2.30.0000.03012.09
5.2.20.0000.03012.09
5.2.10.0030.03012.09
5.2.00.0030.03012.09
5.1.60.0000.02712.09
5.1.50.0000.03312.09
5.1.40.0030.02712.09
5.1.30.0000.02712.09
5.1.20.0070.02312.09
5.1.10.0000.03012.09
5.1.00.0030.02312.09
5.0.50.0070.01312.09
5.0.40.0000.02012.09
5.0.30.0000.03312.09
5.0.20.0000.02012.09
5.0.10.0030.01712.09
5.0.00.0000.03312.09
4.4.90.0000.01712.09
4.4.80.0000.02012.09
4.4.70.0030.01312.09
4.4.60.0000.01712.09
4.4.50.0000.01712.09
4.4.40.0070.02012.09
4.4.30.0000.01312.09
4.4.20.0000.01712.09
4.4.10.0030.01312.09
4.4.00.0000.02312.09
4.3.110.0000.01712.09
4.3.100.0000.01712.09
4.3.90.0000.01312.09
4.3.80.0000.02712.09
4.3.70.0030.01012.09
4.3.60.0030.01012.09
4.3.50.0000.01712.09
4.3.40.0030.02012.09
4.3.30.0000.01712.09
4.3.20.0000.02012.09
4.3.10.0000.02012.09
4.3.00.0000.01312.09

preferences:
38.54 ms | 401 KiB | 5 Q