3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($logfile) { $chars = '0123456789abcdefghijklmnopqrstuvwxyz'; $base = mt_rand(2, 36); $len = mt_rand(10, 100); $str = ''; for ($i = 0; $i < $len; ++$i) { $str .= $chars[mt_rand(0, $base - 1)]; } $gmp = gmp_init($str, $base); $val = gmp_strval($str, $base); $val = str_pad($val, strlen($str), '0', STR_PAD_LEFT); if ($val !== $str) { throw new Exception('Not same - base '.$base."\n-".$str."\n+".$val); } } for($i = 0; $i < 100000; ++$i) { test($logfile); }

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.0110.00715.29
7.3.120.0070.00715.24
7.3.110.0070.01015.26
7.3.100.0000.01415.11
7.3.90.0030.01015.07
7.3.80.0080.00315.22
7.3.70.0040.01115.11
7.3.60.0030.01415.20
7.3.50.0040.00815.21
7.3.40.0060.00615.27
7.3.30.0070.00715.12
7.3.20.0100.00316.76
7.3.10.0040.01417.14
7.3.00.0060.00916.93
7.2.250.0070.01115.21
7.2.240.0030.01715.23
7.2.230.0030.01015.50
7.2.220.0100.00615.20
7.2.210.0100.00715.34
7.2.200.0070.01015.31
7.2.190.0030.01315.16
7.2.180.0130.00015.45
7.2.170.0070.01015.26
7.2.00.0030.00919.71
7.1.330.0060.00916.00
7.1.320.0100.00716.07
7.1.310.0000.01216.13
7.1.300.0030.00716.04
7.1.290.0170.00015.86
7.1.280.0030.01216.16
7.1.270.0030.01015.95
7.1.260.0070.00716.09
7.1.70.0000.00717.53
7.1.60.0120.00919.25
7.1.50.0070.00717.15
7.1.00.0000.08022.53
7.0.200.0030.00716.91
7.0.140.0000.07722.14
7.0.60.0000.09719.84
7.0.50.0100.08018.09
7.0.40.0030.08020.19
7.0.30.0200.05720.34
7.0.20.0270.06320.36
7.0.10.0130.07720.29
7.0.00.0270.05020.37
5.6.280.0030.07321.00
5.6.210.0100.09020.52
5.6.200.0230.07018.35
5.6.190.0100.08720.73
5.6.180.3100.04720.75
5.6.170.0300.03020.70
5.6.160.0030.05020.70
5.6.150.0100.03318.39
5.6.140.0000.05318.27
5.6.130.0030.08718.35
5.6.120.0100.08021.03
5.6.110.0100.03321.18
5.6.100.0070.09021.05
5.6.90.0100.08321.20
5.6.80.0100.07720.42
5.6.70.2730.04720.48
5.5.350.0270.05020.41
5.5.340.0200.06718.22
5.5.330.0200.07020.49
5.5.320.0370.03720.50
5.5.310.0400.06320.67
5.5.300.0070.08018.15
5.5.290.0030.05018.21
5.5.280.0030.05721.07
5.5.270.0130.08320.78
5.5.260.0000.09321.06
5.5.250.0070.06320.86
5.5.240.0170.08020.42
5.4.450.0530.06019.63
5.4.440.0900.07019.66
5.4.430.0800.07319.70
5.4.420.0770.06019.95
5.4.410.0630.06719.57
5.4.400.0100.05719.31
5.4.390.0600.05319.41
5.4.380.0270.05018.98
5.4.370.0370.05018.83
5.4.360.0900.04718.75
5.4.350.0370.05718.75
5.4.340.0300.05318.72
5.4.320.0040.03812.51
5.4.310.0070.04712.50
5.4.300.0090.03912.51
5.4.290.0060.04912.51
5.4.280.0060.03912.41
5.4.270.0100.04612.40
5.4.260.0080.04012.40
5.4.250.0130.04212.40
5.4.240.0080.03612.40
5.4.230.0090.03612.39
5.4.220.0050.03912.39
5.4.210.0110.03412.39
5.4.200.0070.05012.39
5.4.190.0060.03712.39
5.4.180.0070.03812.39
5.4.170.0120.04112.40
5.4.160.0080.04612.39
5.4.150.0060.04412.39
5.4.140.0070.04012.07
5.4.130.0030.03912.06
5.4.120.0070.04012.02
5.4.110.0050.03712.02
5.4.100.0120.04112.02
5.4.90.0040.04412.01
5.4.80.0080.03812.01
5.4.70.0070.03512.01
5.4.60.0070.05312.01
5.4.50.0070.03412.02
5.4.40.0060.03512.00
5.4.30.0050.04812.00
5.4.20.0100.03912.00
5.4.10.0050.04711.99
5.4.00.0080.03611.48
5.3.290.0080.03812.80
5.3.280.0060.04112.71
5.3.270.0060.04512.73
5.3.260.0090.03612.71
5.3.250.0060.04012.72
5.3.240.0100.04812.72
5.3.230.0070.03912.71
5.3.220.0060.04212.68
5.3.210.0070.03812.68
5.3.200.0090.04612.68
5.3.190.0080.04912.68
5.3.180.0050.03912.67
5.3.170.0090.04212.67
5.3.160.0100.03812.67
5.3.150.0110.04812.67
5.3.140.0060.03912.66
5.3.130.0080.04212.66
5.3.120.0070.04212.66
5.3.110.0070.04112.66
5.3.100.0070.04212.13
5.3.90.0030.04012.11
5.3.80.0040.04512.10
5.3.70.0050.04012.10
5.3.60.0050.04212.09
5.3.50.0090.04512.03
5.3.40.0080.03612.04
5.3.30.0040.04811.98
5.3.20.0060.04311.77
5.3.10.0050.04811.73
5.3.00.0100.03411.73
5.2.170.0100.0319.22
5.2.160.0030.0349.23
5.2.150.0030.0319.23
5.2.140.0040.0319.22
5.2.130.0040.0309.18
5.2.120.0040.0299.18
5.2.110.0080.0269.19
5.2.100.0030.0309.18
5.2.90.0050.0349.19
5.2.80.0040.0319.18
5.2.70.0050.0299.18
5.2.60.0050.0309.13
5.2.50.0030.0309.10
5.2.40.0040.0309.08
5.2.30.0050.0359.05
5.2.20.0060.0279.04
5.2.10.0040.0348.94
5.2.00.0090.0318.81
5.1.60.0040.0268.09
5.1.50.0020.0288.09
5.1.40.0050.0268.07
5.1.30.0100.0328.41
5.1.20.0070.0348.44
5.1.10.0020.0288.17
5.1.00.0030.0278.16
5.0.50.0020.0216.66
5.0.40.0050.0206.51
5.0.30.0030.0336.33
5.0.20.0060.0246.29
5.0.10.0030.0206.27
5.0.00.0030.0316.27
4.4.90.0020.0194.78
4.4.80.0040.0234.76
4.4.70.0030.0154.75
4.4.60.0040.0144.75
4.4.50.0060.0144.77
4.4.40.0030.0274.71
4.4.30.0040.0324.75
4.4.20.0040.0194.85
4.4.10.0030.0154.85
4.4.00.0030.0264.76
4.3.110.0030.0164.67
4.3.100.0040.0134.66
4.3.90.0020.0154.63
4.3.80.0040.0234.58
4.3.70.0040.0144.63
4.3.60.0040.0154.62
4.3.50.0020.0174.63
4.3.40.0040.0294.54
4.3.30.0030.0153.31
4.3.20.0010.0203.29
4.3.10.0040.0143.25
4.3.00.0000.0237.20

preferences:
42.08 ms | 401 KiB | 5 Q