3v4l.org

run code in 300+ PHP versions simultaneously
<?php function encode_char($c) { $sum = ord($c); $first = rand(-100,100); $second = rand(-100,100); $third = $sum - ($first + $second); return [$first, $second, $third]; } function encode_string($st) { $encoded_string = []; foreach ($st as $c) { array_push($encoded_string, encode_char($c)); } return $encoded_string; } function str_rep($encoded_string) { $str_rep = []; foreach ($encoded_string as $encoded_c) { array_push($str_rep, join(",", $encoded_c)); } return join(";", $str_rep); } print(str_rep('ab')); ?>

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.0030.01319.38
7.1.70.0140.00717.03
7.1.60.0090.00516.89
7.1.50.0050.00817.00
7.1.40.0040.00716.58
7.1.30.0060.00616.77
7.1.20.0040.00716.73
7.1.10.0030.00516.81
7.1.00.0000.01016.67
7.0.200.0000.01016.86
7.0.190.0040.00416.67
7.0.180.0060.00316.21
7.0.170.0030.00516.50
7.0.160.0030.00716.42
7.0.150.0100.00316.19
7.0.140.0030.00616.27
7.0.130.0020.00516.48
7.0.120.0050.00216.48
7.0.110.0000.00916.30
7.0.100.0030.00716.59
7.0.90.0000.00816.21
7.0.80.0050.00316.45
7.0.70.0000.00816.36
7.0.60.0040.00415.93
7.0.50.0000.01316.34
7.0.40.0000.00814.81
7.0.30.0000.00714.80
7.0.20.0000.00814.80
7.0.10.0040.00414.80
7.0.00.0000.00814.80
5.6.300.0060.05520.68
5.6.290.0030.05220.83
5.6.280.0030.04321.00
5.6.270.0130.03120.87
5.6.260.0030.04320.88
5.6.250.0060.04221.03
5.6.240.0030.04220.85
5.6.230.0030.04020.86
5.6.220.0030.04420.97
5.6.210.0030.04020.89
5.6.200.0030.04620.97
5.6.190.0030.04720.84
5.6.180.0070.04020.97
5.6.170.0030.03920.87
5.6.160.0030.04020.84
5.6.150.0030.04420.78
5.6.140.0060.03820.77
5.6.130.0030.05021.04
5.6.120.0000.04520.83
5.6.110.0030.04220.95
5.6.100.0000.04520.76
5.6.90.0030.04120.96
5.6.80.0060.03520.22
5.6.70.0070.05620.37
5.6.60.0070.04020.37
5.6.50.0060.03520.13
5.6.40.0100.03320.40
5.6.30.0070.03620.20
5.6.20.0260.03820.30
5.6.10.0000.04620.18
5.6.00.0060.03520.27
5.5.380.0070.05317.54
5.5.370.0000.04217.50
5.5.360.0070.04317.64
5.5.350.0130.03017.57
5.5.340.0070.03717.83
5.5.330.0060.04218.09
5.5.320.0030.05017.75
5.5.310.0070.05918.13
5.5.300.0100.03518.13
5.5.290.0030.04118.10
5.5.280.0100.04218.09
5.5.270.0070.03718.08
5.5.260.0030.06418.13
5.5.250.0000.04217.82
5.5.240.0030.05317.08
5.5.230.0000.04217.50
5.5.220.0000.05017.47
5.5.210.0000.05917.41
5.5.200.0000.04017.06
5.5.190.0000.04317.05
5.5.180.0070.04017.45
5.5.160.0000.04317.36
5.5.150.0000.04317.32
5.5.140.0030.03917.52
5.5.130.0100.04217.20
5.5.120.0000.04317.21
5.5.110.0030.03817.38
5.5.100.0070.03717.00
5.5.90.0030.03617.07
5.5.80.0000.04117.29
5.5.70.0000.04217.29
5.5.60.0030.05117.32
5.5.50.0030.05817.28
5.5.40.0070.07217.34
5.5.30.0040.03917.36
5.5.20.0070.04717.32
5.5.10.0060.03816.94
5.5.00.0030.07916.97
5.4.450.0060.04519.33
5.4.440.0070.03619.32
5.4.430.0140.03719.50
5.4.420.0030.04119.21
5.4.410.0030.06919.43
5.4.400.0060.03418.95
5.4.390.0070.06919.14
5.4.380.0030.03718.97
5.4.370.0030.06319.07
5.4.360.0060.04819.09
5.4.350.0030.04019.21
5.4.340.0030.04319.23
5.4.320.0000.04119.08
5.4.310.0030.03819.07
5.4.300.0000.04419.11
5.4.290.0060.04219.04
5.4.280.0030.05219.00
5.4.270.0030.03619.08
5.4.260.0030.03819.07
5.4.250.0070.03419.20
5.4.240.0090.03518.97
5.4.230.0030.04018.97
5.4.220.0000.04219.05
5.4.210.0070.03418.98
5.4.200.0000.05318.94
5.4.190.0090.03118.98
5.4.180.0030.06119.15
5.4.170.0030.04219.05
5.4.160.0000.04818.95
5.4.150.0030.03919.21
5.4.140.0160.06916.52
5.4.130.0070.06716.81
5.4.120.0100.03116.82
5.4.110.0030.04616.81
5.4.100.0070.03416.83
5.4.90.0100.03016.77
5.4.80.0030.03516.68
5.4.70.0030.03916.75
5.4.60.0030.05016.77
5.4.50.0000.04316.61
5.4.40.0000.04716.67
5.4.30.0000.04816.45
5.4.20.0030.03916.74
5.4.10.0100.05316.61
5.4.00.0070.03316.28
5.3.290.0000.04314.80
5.3.280.0100.03914.86
5.3.270.0000.06814.86
5.3.260.0030.03814.89
5.3.250.0000.04314.88
5.3.240.0090.03114.88
5.3.230.0000.06514.80
5.3.220.0040.03514.83
5.3.210.0000.04414.80
5.3.200.0030.04614.87
5.3.190.0030.04014.80
5.3.180.0100.04514.84
5.3.170.0030.05614.82
5.3.160.0170.03714.80
5.3.150.0030.07114.80
5.3.140.0000.04114.80
5.3.130.0000.04414.80
5.3.120.0000.05514.90
5.3.110.0070.04514.81
5.3.100.0000.04214.80
5.3.90.0130.04614.80
5.3.80.0030.04314.80
5.3.70.0100.04714.80
5.3.60.0100.03214.80
5.3.50.0030.04214.80
5.3.40.0070.04114.80
5.3.30.0000.04214.80
5.3.20.0090.03514.80
5.3.10.0000.04814.80
5.3.00.0110.03214.80
5.2.170.0060.03814.80
5.2.160.0000.03514.80
5.2.150.0070.03614.80
5.2.140.0160.02314.80
5.2.130.0030.02914.80
5.2.120.0040.04214.80
5.2.110.0000.03314.80
5.2.100.0030.03114.80
5.2.90.0000.03714.80
5.2.80.0120.02514.80
5.2.70.0170.03014.80
5.2.60.0040.03514.80
5.2.50.0100.02914.80
5.2.40.0040.02914.80
5.2.30.0030.03514.80
5.2.20.0000.03214.80
5.2.10.0000.03114.80
5.2.00.0030.02814.80
5.1.60.0030.02414.80
5.1.50.0000.03014.80
5.1.40.0000.02714.80
5.1.30.0000.03114.80
5.1.20.0000.02914.80
5.1.10.0000.02914.80
5.1.00.0000.03114.80
5.0.50.0000.02914.80
5.0.40.0030.01914.80
5.0.30.0160.02914.80
5.0.20.0100.01314.80
5.0.10.0060.02214.80
5.0.00.0000.03314.80
4.4.90.0030.01514.80
4.4.80.0000.01714.80
4.4.70.0000.01814.80
4.4.60.0030.01314.80
4.4.50.0000.01714.80
4.4.40.0040.02514.80
4.4.30.0030.01714.80
4.4.20.0000.01714.80
4.4.10.0040.01514.80
4.4.00.0000.02914.80
4.3.110.0030.01814.80
4.3.100.0070.01914.80
4.3.90.0040.01214.80
4.3.80.0000.02514.80
4.3.70.0030.01414.80
4.3.60.0000.01814.80
4.3.50.0000.02214.80
4.3.40.0030.02614.80
4.3.30.0030.01914.80
4.3.20.0000.01814.80
4.3.10.0040.01514.80
4.3.00.0040.01814.80

preferences:
39.41 ms | 400 KiB | 5 Q