3v4l.org

run code in 300+ PHP versions simultaneously
<?php $vars = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'); $start = microtime(true); for($k=0;$k<100;$k++) { $str = ltrim(strrev(chunk_split(implode(array_reverse($vars)), 3, ';')),';'); } $end = microtime(true); echo $end - $start; echo "\n\n"; $start = microtime(true); for($k=0;$k<100;$k++) { $size = sizeOf($vars); for ($i = $size-3; $i > 0; $i-=3) { array_splice($vars,$i,0,";"); } } $end = microtime(true); echo $end - $start;

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.0002.50121.48
7.1.70.0072.49419.24
7.1.60.5241.97821.48
7.1.50.5071.99421.18
7.1.00.0072.49324.36
7.0.200.0032.49818.88
7.0.140.0002.50024.01
7.0.60.0072.49322.14
7.0.50.0132.48719.96
7.0.40.0132.48719.79
7.0.30.0272.47319.87
7.0.20.0302.47019.93
7.0.10.0202.48019.72
7.0.00.0032.49719.64
5.6.280.0032.49723.98
5.6.210.0132.48723.43
5.6.200.0032.49721.20
5.6.190.0072.47323.34
5.6.180.0132.48723.32
5.6.170.0402.46023.27
5.6.160.0102.49023.29
5.6.150.0102.49021.09
5.6.140.0032.49721.09
5.6.130.0102.49021.11
5.6.120.0072.49324.07
5.6.110.0102.49024.01
5.6.100.0102.49024.01
5.6.90.0172.48324.05
5.6.80.0102.49023.56
5.6.70.0372.46323.78
5.5.350.0032.49722.93
5.5.340.0002.50020.42
5.5.330.0002.50022.64
5.5.320.0402.46022.60
5.5.310.0432.45722.70
5.5.300.0102.49020.50
5.5.290.0032.49720.47
5.5.280.0032.49723.34
5.5.270.0132.48723.27
5.5.260.0072.49323.38
5.5.250.0132.48723.03
5.5.240.0032.49722.58
5.4.450.0472.45021.82
5.4.440.4132.08321.03
5.4.430.0172.48021.80
5.4.420.4302.06721.18
5.4.410.0272.47021.65
5.4.400.0302.46721.05
5.4.390.0032.49321.47
5.4.380.0332.46721.70
5.4.370.0302.46721.51
5.4.360.0032.49321.48
5.4.350.0202.47721.00
5.4.340.0272.44321.05
5.4.320.0131.98814.87
5.4.310.0101.99014.94
5.4.300.0101.99214.88
5.4.290.0101.99914.50
5.4.280.0111.99014.39
5.4.270.0171.98714.39
5.4.260.0131.99114.39
5.4.250.0091.99214.39
5.4.240.0081.99214.39
5.4.230.0081.99314.38
5.4.220.0091.99214.38
5.4.210.0071.99514.38
5.4.200.0071.99414.38
5.4.190.0091.99214.38
5.4.180.0101.99014.38
5.4.170.0111.99014.39
5.4.160.0131.98814.39
5.4.150.0081.99414.39
5.4.140.0101.99214.07
5.4.130.0141.98814.06
5.4.120.0041.99614.02
5.4.110.0111.99114.01
5.4.100.0071.99314.01
5.4.90.0091.99314.01
5.4.80.0171.98514.00
5.4.70.0171.98614.01
5.4.60.0121.99014.00
5.4.50.0111.98914.00
5.4.40.0071.99413.99
5.4.30.0081.99213.99
5.4.20.0091.99313.99
5.4.10.0081.99313.99
5.4.00.0081.99313.48

preferences:
33.02 ms | 401 KiB | 5 Q