3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'var/log/some/other/directory/file.log'; $array = explode('/', $string); for ($c = count($array); $c > 0; ) { $output[--$c] = implode('/', $array); array_pop($array); } for ($i = 0; $i < count($output); $i++) { echo "$output[$i]\n"; }

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)
8.3.60.0000.01518.30
8.3.50.0100.01018.28
8.3.40.0070.00718.68
8.3.30.0090.00618.75
8.3.20.0000.00821.02
8.3.10.0050.00321.73
8.3.00.0070.00021.70
8.2.180.0090.00618.53
8.2.170.0110.00422.96
8.2.160.0090.00619.19
8.2.150.0070.00724.18
8.2.140.0030.00724.66
8.2.130.0040.00426.16
8.2.120.0080.00020.63
8.2.110.0060.00321.13
8.2.100.0050.00517.97
8.2.90.0040.00417.97
8.2.80.0040.00417.97
8.2.70.0060.00317.91
8.2.60.0060.00618.22
8.2.50.0040.00718.18
8.2.40.0080.00019.47
8.2.30.0080.00019.30
8.2.20.0000.00818.09
8.2.10.0040.00419.36
8.2.00.0000.00718.11
8.1.280.0120.00325.92
8.1.270.0060.00320.72
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00422.29
8.1.230.0170.00020.70
8.1.220.0040.00417.79
8.1.210.0000.00918.77
8.1.200.0030.00617.35
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0060.00317.62
8.1.160.0060.00318.88
8.1.150.0070.00018.93
8.1.140.0000.00818.80
8.1.130.0040.00417.49
8.1.120.0030.00317.34
8.1.110.0030.00317.38
8.1.100.0040.00417.51
8.1.90.0090.00217.47
8.1.80.0040.00417.34
8.1.70.0080.00017.34
8.1.60.0040.00417.55
8.1.50.0050.00217.41
8.1.40.0040.00817.56
8.1.30.0030.00517.57
8.1.20.0050.00317.68
8.1.10.0000.00817.53
8.1.00.0000.00817.55
8.0.300.0000.00721.96
8.0.290.0050.00316.75
8.0.280.0000.00718.43
8.0.270.0030.00317.17
8.0.260.0080.00016.80
8.0.250.0030.00316.94
8.0.240.0030.00316.99
8.0.230.0070.00016.95
8.0.220.0000.00716.90
8.0.210.0030.00316.86
8.0.200.0030.00316.90
8.0.190.0000.00816.85
8.0.180.0030.00616.93
8.0.170.0070.00316.91
8.0.160.0070.00016.84
8.0.150.0030.00316.87
8.0.140.0070.00016.89
8.0.130.0000.00613.26
8.0.120.0040.00416.76
8.0.110.0070.00016.93
8.0.100.0030.00316.75
8.0.90.0000.00816.77
8.0.80.0120.00516.85
8.0.70.0040.00416.91
8.0.60.0000.00816.92
8.0.50.0000.00716.93
8.0.30.0130.01517.22
8.0.20.0110.01417.04
8.0.10.0000.00816.91
8.0.00.0120.00716.74
7.4.330.0000.00615.55
7.4.320.0030.00316.58
7.4.300.0030.00316.47
7.4.290.0070.00016.48
7.4.280.0030.00316.50
7.4.270.0030.00316.46
7.4.260.0040.00416.49
7.4.250.0000.00716.47
7.4.240.0050.00316.40
7.4.230.0040.00416.40
7.4.220.0030.00516.55
7.4.210.0070.01016.59
7.4.200.0030.00316.48
7.4.160.0090.00716.51
7.4.140.0110.00817.86
7.4.130.0140.00416.51
7.4.120.0090.01216.52
7.4.110.0060.01216.63
7.4.100.0110.00816.29
7.4.90.0090.00816.44
7.4.80.0120.00919.39
7.4.70.0080.01116.45
7.4.60.0120.00416.54
7.4.50.0030.01016.48
7.4.40.0040.01216.58
7.4.00.0030.01414.86
7.3.330.0030.00613.15
7.3.320.0030.00313.12
7.3.310.0000.00716.14
7.3.300.0030.00316.36
7.3.290.0000.00716.32
7.3.280.0090.01016.27
7.3.260.0100.00816.36
7.3.240.0070.00916.40
7.3.230.0030.01416.62
7.3.210.0110.00716.31
7.3.200.0060.01116.45
7.3.190.0150.00616.27
7.3.180.0000.01616.43
7.3.170.0070.01316.43
7.3.160.0130.00616.52
7.3.120.0160.00314.87
7.3.110.0070.01114.96
7.3.100.0100.00615.08
7.3.90.0070.01114.88
7.3.80.0040.01114.71
7.3.70.0060.01214.97
7.3.60.0110.00414.88
7.3.50.0100.00614.46
7.3.40.0040.00814.81
7.3.30.0030.01414.57
7.3.20.0060.00616.56
7.3.10.0420.00615.38
7.3.00.0230.01015.79
7.2.330.0070.01116.72
7.2.320.0060.01116.80
7.2.310.0070.01016.79
7.2.300.0110.00716.76
7.2.290.0140.00316.80
7.2.250.0040.01514.99
7.2.240.0100.01014.92
7.2.230.0040.00815.26
7.2.220.0040.01414.80
7.2.210.0090.00615.07
7.2.200.0000.01514.99
7.2.190.0060.00914.97
7.2.180.0100.00314.99
7.2.170.0070.00715.00
7.2.130.0550.00015.01
7.2.120.0590.00314.82
7.2.110.0730.00714.94
7.2.100.0610.00314.80
7.2.90.0510.00715.09
7.2.80.0850.00314.80
7.2.70.0660.00015.36
7.2.60.0580.00614.96
7.2.50.0770.00614.98
7.2.40.0480.00214.76
7.2.30.0490.00715.02
7.2.20.0570.00314.92
7.2.10.0580.00314.77
7.2.00.0580.01015.00
7.1.330.0070.01015.74
7.1.320.0140.00415.98
7.1.310.0060.00915.73
7.1.300.0070.00715.88
7.1.290.0030.01015.99
7.1.280.0040.01115.82
7.1.270.0070.00415.73
7.1.260.0030.01016.00
7.1.250.0470.00013.85

preferences:
52.45 ms | 400 KiB | 5 Q