3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time_start = microtime(true); $test1 = ''; for($t=0; $t<10; $t++) { for($i=0; $i<255; $i++) { $tmp = unpack('H*', chr($i)); $test1 .= '\\x'.array_shift($tmp); } } $time_end = microtime(true); $time = $time_end - $time_start; echo "$time seconds\n"; $time_start = microtime(true); $test2 = ''; for($t=0; $t<10; $t++) { for($i=0; $i<255; $i++) { $test2 .= '\\x'.str_pad(base_convert($i, 10, 16), 2, 0, STR_PAD_LEFT); } } $time_end = microtime(true); $time = $time_end - $time_start; echo "$time seconds\n"; echo ($test1 === $test2) ? 'OK' : 'NOT OK'; ?>

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.2.00.0000.01119.41
7.1.70.0030.00616.91
7.1.60.0030.01616.93
7.1.50.0040.00816.77
7.1.40.0130.00316.52
7.1.30.0060.00616.70
7.1.20.0030.00916.79
7.1.10.0000.00916.48
7.1.00.0000.01216.78
7.0.200.0070.01016.52
7.0.190.0100.00616.83
7.0.180.0030.00616.32
7.0.170.0080.00516.39
7.0.160.0040.00416.41
7.0.150.0040.01516.30
7.0.140.0030.00616.25
7.0.130.0040.01116.82
7.0.120.0000.01216.72
7.0.110.0030.00616.31
7.0.100.0030.00616.37
7.0.90.0000.00916.43
7.0.80.0030.01716.35
7.0.70.0030.00716.30
7.0.60.0000.01216.14
7.0.50.0000.01116.38
7.0.40.0030.00614.63
7.0.30.0070.00714.63
7.0.20.0000.01114.63
7.0.10.0030.01014.63
7.0.00.0000.01014.63
5.6.300.0030.05520.91
5.6.290.0070.06720.90
5.6.280.0030.04320.83
5.6.270.0000.05821.02
5.6.260.0070.05020.85
5.6.250.0070.05120.84
5.6.240.0030.04320.82
5.6.230.0030.07420.90
5.6.220.0030.05720.75
5.6.210.0000.05520.60
5.6.200.0000.05120.80
5.6.190.0060.05220.91
5.6.180.0030.04520.97
5.6.170.0060.04321.00
5.6.160.0170.05520.93
5.6.150.0070.04720.79
5.6.140.0030.04720.85
5.6.130.0030.04520.89
5.6.120.0030.05620.99
5.6.110.0060.04920.82
5.6.100.0030.04321.00
5.6.90.0070.05020.91
5.6.80.0000.04520.37
5.6.70.0100.08320.28
5.6.60.0070.04020.17
5.6.50.0100.03520.36
5.6.40.0000.04720.35
5.6.30.0030.05620.22
5.6.20.0030.04120.12
5.6.10.0070.07520.17
5.6.00.0000.05520.15
5.5.380.0070.05017.47
5.5.370.0090.04117.43
5.5.360.0100.04517.54
5.5.350.0120.04017.48
5.5.340.0070.04317.97
5.5.330.0000.05218.12
5.5.320.0040.05018.05
5.5.310.0030.04917.94
5.5.300.0060.04117.86
5.5.290.0190.02818.00
5.5.280.0040.06017.94
5.5.270.0000.06617.73
5.5.260.0070.05318.06
5.5.250.0320.03617.55
5.5.240.0070.04517.38
5.5.230.0030.05217.08
5.5.220.0030.04817.40
5.5.210.0040.04617.32
5.5.200.0030.04717.42
5.5.190.0030.04517.05
5.5.180.0030.04117.34
5.5.160.0030.04717.19
5.5.150.0000.04517.38
5.5.140.0030.04817.41
5.5.130.0030.06917.38
5.5.120.0030.04417.09
5.5.110.0070.03817.20
5.5.100.0030.04117.25
5.5.90.0000.04417.11
5.5.80.0090.03317.28
5.5.70.0000.04717.30
5.5.60.0000.04617.22
5.5.50.0090.03717.27
5.5.40.0000.04517.18
5.5.30.0000.04717.26
5.5.20.0030.04016.98
5.5.10.0030.05117.20
5.5.00.0000.04617.30
5.4.450.0070.06219.31
5.4.440.0150.03319.38
5.4.430.0070.05719.36
5.4.420.0100.03519.30
5.4.410.0400.04419.08
5.4.400.0030.04019.02
5.4.390.0030.05318.85
5.4.380.0120.03418.98
5.4.370.0070.04019.06
5.4.360.0000.04619.13
5.4.350.0070.04418.98
5.4.340.0170.05019.01
5.4.320.0120.03418.95
5.4.310.0040.04619.16
5.4.300.0070.06319.07
5.4.290.0000.04318.88
5.4.280.0030.04119.02
5.4.270.0000.04619.06
5.4.260.0000.04919.06
5.4.250.0070.06219.06
5.4.240.0030.04819.01
5.4.230.0130.04019.13
5.4.220.0030.04619.05
5.4.210.0030.04519.06
5.4.200.0040.04019.06
5.4.190.0030.04519.10
5.4.180.0070.05019.16
5.4.170.0030.04019.05
5.4.160.0040.03918.98
5.4.150.0000.04519.06
5.4.140.0040.05216.38
5.4.130.0030.04416.33
5.4.120.0030.03716.48
5.4.110.0000.04116.68
5.4.100.0030.04216.37
5.4.90.0030.03916.35
5.4.80.0060.03816.41
5.4.70.0070.03816.36
5.4.60.0070.05016.55
5.4.50.0070.03616.55
5.4.40.0200.03416.53
5.4.30.0030.06216.32
5.4.20.0030.03716.43
5.4.10.0000.05016.64
5.4.00.0000.04316.07
5.3.290.0000.04614.91
5.3.280.0130.03214.63
5.3.270.0030.04314.81
5.3.260.0070.04214.79
5.3.250.0030.04114.63
5.3.240.0000.04414.63
5.3.230.0000.05514.63
5.3.220.0000.04114.75
5.3.210.0030.05814.63
5.3.200.0040.04314.63
5.3.190.0000.04414.63
5.3.180.0000.04514.73
5.3.170.0060.04414.76
5.3.160.0100.03214.63
5.3.150.0030.04114.76
5.3.140.0000.04214.79
5.3.130.0030.04314.63
5.3.120.0030.04314.64
5.3.110.0000.04414.63
5.3.100.0060.04514.63
5.3.90.0100.03714.63
5.3.80.0090.03414.63
5.3.70.0030.04014.63
5.3.60.0000.04614.63
5.3.50.0040.03914.63
5.3.40.0070.03314.63
5.3.30.0040.03714.63
5.3.20.0000.04414.63
5.3.10.0000.05414.63
5.3.00.0000.05014.63
5.2.170.0030.03114.63
5.2.160.0040.02914.63
5.2.150.0130.04414.63
5.2.140.0100.02914.63
5.2.130.0030.03014.63
5.2.120.0070.03014.63
5.2.110.0000.03414.63
5.2.100.0070.02614.63
5.2.90.0030.02914.63
5.2.80.0030.03814.63
5.2.70.0030.03114.63
5.2.60.0000.03414.63
5.2.50.0000.03414.63
5.2.40.0060.03514.63
5.2.30.0060.03614.63
5.2.20.0030.03514.63
5.2.10.0030.03114.63
5.2.00.0060.02814.63
5.1.60.0060.02414.63
5.1.50.0000.04714.63
5.1.40.0040.02814.63
5.1.30.0040.03314.63
5.1.20.0000.03414.63
5.1.10.0000.03414.63
5.1.00.0140.02414.63
5.0.50.0000.03114.63
5.0.40.0000.04014.63
5.0.30.0070.02814.68
5.0.20.0000.02914.80
5.0.10.0030.04614.80
5.0.00.0030.05114.80
4.4.90.0030.02414.63
4.4.80.0000.02114.63
4.4.70.0000.04414.63
4.4.60.0000.02514.63
4.4.50.0000.02814.63
4.4.40.0030.04714.63
4.4.30.0130.01314.63
4.4.20.0060.01814.63
4.4.10.0000.03014.63
4.4.00.0000.03614.63
4.3.110.0030.02514.68
4.3.100.0060.01314.72
4.3.90.0060.02114.80
4.3.80.0000.02914.80
4.3.70.0030.01814.80
4.3.60.0000.02314.80
4.3.50.0030.01914.80
4.3.40.0000.03214.80
4.3.30.0040.02514.80
4.3.20.0030.01914.80
4.3.10.0070.01614.80
4.3.00.0030.02514.80

preferences:
38.59 ms | 401 KiB | 5 Q