3v4l.org

run code in 300+ PHP versions simultaneously
<?php $path = '/some/path/'; $start = microtime(true); for ($i = 0; $i < 100000; $i++) { if (substr( $path, -1 ) == '/') $path = substr( $path, 0, -1 ); } $end = microtime(true); echo "<br>\n" . $end - $start; $path = '/some/path'; $start = microtime(true); for ($i = 0; $i < 100000; $i++) { if (substr( $path, -1 ) == '/') $path = substr( $path, 0, -1 ); } $end = microtime(true); echo "<br>\n" . $end - $start; $path = '/some/path/'; $start = microtime(true); for ($i = 0; $i < 100000; $i++) { $path = rtrim($path, '/'); } $end = microtime(true); echo "<br>\n" . $end - $start; $path = '/some/path'; $start = microtime(true); for ($i = 0; $i < 100000; $i++) { $path = rtrim($path, '/'); } $end = microtime(true); echo "<br>\n" . $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.4.00.0100.02715.12
7.3.120.0080.02814.77
7.3.110.0080.02814.46
7.3.100.0090.02114.87
7.3.90.0080.02114.77
7.3.80.0080.02214.96
7.3.70.0080.02014.72
7.3.60.0090.01914.75
7.3.50.0050.02114.83
7.3.40.0080.02214.79
7.3.30.0070.02114.94
7.3.20.0100.02116.61
7.3.10.0060.02116.54
7.3.00.0070.02216.70
7.2.250.0100.03115.00
7.2.240.0080.03014.85
7.2.230.0070.02615.11
7.2.220.0070.02215.31
7.2.210.0070.02414.87
7.2.200.0030.02715.03
7.2.190.0060.02415.01
7.2.180.0030.03115.11
7.2.170.0020.02715.01
7.2.160.0030.03514.83
7.2.150.0030.02717.10
7.2.140.0090.02216.86
7.2.130.0060.02516.85
7.2.120.0030.02416.90
7.2.110.0100.02116.78
7.2.100.0020.02616.75
7.2.90.0130.01916.87
7.2.80.0060.02316.73
7.2.70.0040.02816.84
7.2.60.0060.02516.87
7.2.50.0070.02317.00
7.2.40.0030.02416.61
7.2.30.0030.02616.87
7.2.20.0050.02416.82
7.2.10.0090.02316.84
7.2.00.0040.02517.77
7.1.330.0030.05815.91
7.1.320.0060.04915.78
7.1.310.0100.05115.83
7.1.300.0050.05515.56
7.1.290.0070.04615.96
7.1.280.0080.05515.88
7.1.270.0020.05315.68
7.1.260.0070.05815.91
7.1.250.0050.05315.80
7.1.240.0130.04715.86
7.1.230.0100.04715.59
7.1.220.0100.05215.79
7.1.210.0030.05316.04
7.1.200.0060.04915.82
7.1.190.0070.05615.91
7.1.180.0030.05315.75
7.1.170.0030.05215.71
7.1.160.0100.04815.56
7.1.150.0070.05215.65
7.1.140.0030.04715.62
7.1.130.0000.05415.84
7.1.120.0100.05015.79
7.1.110.0100.05315.86
7.1.100.0130.04815.73
7.1.90.0030.05615.82
7.1.80.0100.05315.68
7.1.70.0070.04116.58
7.1.60.0110.04617.67
7.1.50.0070.05116.42
7.1.40.0070.05415.57
7.1.30.0030.05715.79
7.1.20.0030.04915.91
7.1.10.0070.05415.78
7.1.00.0080.07019.11
7.0.330.0100.05115.50
7.0.320.0040.05315.22
7.0.310.0100.05415.31
7.0.300.0070.05115.57
7.0.290.0070.05115.43
7.0.280.0030.05015.23
7.0.270.0070.04815.32
7.0.260.0000.05915.10
7.0.250.0030.05715.43
7.0.240.0030.05515.38
7.0.230.0130.05515.62
7.0.220.0060.05115.13
7.0.210.0070.05415.51
7.0.200.0030.03616.08
7.0.190.0070.05215.43
7.0.180.0100.05315.48
7.0.170.0100.05415.43
7.0.160.0030.05715.42
7.0.150.0030.05215.48
7.0.140.0050.07218.78
7.0.130.0060.05815.59
7.0.120.0070.07918.84
7.0.110.0000.07115.59
7.0.100.0030.06015.52
7.0.90.0070.05215.54
7.0.80.0030.04815.41
7.0.70.0030.05615.44
7.0.60.0070.07817.61
7.0.50.0050.07716.79
7.0.40.0070.07516.84
7.0.30.0150.07016.78
7.0.20.0100.05816.80
7.0.10.0150.05916.87
7.0.00.0030.08116.76
5.6.380.0070.13814.57
5.6.370.0070.14214.44
5.6.360.0070.14514.16
5.6.350.0070.14014.20
5.6.340.0030.13714.32
5.6.330.0030.13414.53
5.6.320.0130.14014.44
5.6.310.0100.14214.29
5.6.300.0070.13614.12
5.6.290.0030.14114.21
5.6.280.0030.15717.67
5.6.270.0000.17414.49
5.6.260.0030.13714.54
5.6.250.0100.13114.32
5.6.240.0070.15914.25
5.6.230.0100.13714.43
5.6.220.0070.14714.41
5.6.210.0050.14817.33
5.6.200.0120.14616.16
5.6.190.0030.12517.34
5.6.180.0130.12817.54
5.6.170.0130.14017.23
5.6.160.0050.16017.28
5.6.150.0070.16316.18
5.6.140.0070.15416.22
5.6.130.0050.12116.17
5.6.120.0050.15217.63
5.6.110.0080.16117.69
5.6.100.0100.14617.77
5.6.90.0030.13017.75
5.6.80.0050.12017.47
5.6.70.0280.14417.26
5.6.60.0030.14113.99
5.6.50.0030.14213.71
5.6.40.0000.14514.10
5.6.30.0160.13214.44
5.6.20.0130.13514.14
5.6.10.0100.13514.35
5.6.00.0030.14014.23
5.5.380.0030.15910.72
5.5.370.0000.15810.73
5.5.360.0030.15411.13
5.5.350.0080.14715.57
5.5.340.0030.14614.68
5.5.330.0070.15515.54
5.5.320.0130.12015.63
5.5.310.0100.12315.59
5.5.300.0050.14614.41
5.5.290.0020.13014.47
5.5.280.0070.12516.07
5.5.270.0050.14716.04
5.5.260.0080.13715.96
5.5.250.0080.15515.94
5.5.240.0050.15515.51
5.5.230.0030.14811.16
5.5.220.0070.14310.97
5.5.210.0000.14510.96
5.5.200.0030.15111.21
5.5.190.0070.14111.02
5.5.180.0030.14010.86
5.5.170.0030.14410.90
5.5.160.0030.13810.79
5.5.150.0070.14911.21
5.5.140.0000.14810.95
5.5.130.0030.13611.16
5.5.120.0000.14110.62
5.5.110.0000.15510.89
5.5.100.0070.13310.87
5.5.90.0030.14111.07
5.5.80.0100.13710.90
5.5.70.0070.16210.81
5.5.60.0070.13210.99
5.5.50.0030.14410.86
5.5.40.0060.13711.04
5.5.30.0000.16111.22
5.5.20.0030.15810.65
5.5.10.0030.15010.77
5.5.00.0030.14210.90
5.4.450.0070.11915.11
5.4.440.0070.12115.25
5.4.430.0050.12215.06
5.4.420.0080.13115.31
5.4.410.0050.12315.15
5.4.400.0020.11914.97
5.4.390.0080.11214.99
5.4.380.0120.11314.88
5.4.370.0050.12314.96
5.4.360.0050.13114.89
5.4.350.0050.14815.09
5.4.340.0080.13614.82
5.4.330.0100.13910.89
5.4.320.0050.14515.06
5.4.310.0150.15014.97
5.4.300.0090.15514.92
5.4.290.0070.14515.00
5.4.280.0070.11715.03
5.4.270.0030.15114.77
5.4.260.0030.14914.53
5.4.250.0120.14714.79
5.4.240.0030.16214.80
5.4.230.0030.16114.90
5.4.220.0070.15115.01
5.4.210.0050.15115.01
5.4.200.0100.11814.80
5.4.190.0070.13814.75
5.4.180.0050.16014.82
5.4.170.0120.14914.73
5.4.160.0100.14515.07
5.4.150.0020.13014.85
5.4.140.0030.12313.46
5.4.130.0030.14113.38
5.4.120.0100.14213.46
5.4.110.0050.15813.38
5.4.100.0070.12413.38
5.4.90.0100.12613.44
5.4.80.0100.14413.56
5.4.70.0070.17013.53
5.4.60.0070.14613.55
5.4.50.0050.13513.57
5.4.40.0030.14913.65
5.4.30.0050.14913.65
5.4.20.0080.12213.64
5.4.10.0050.14813.55
5.4.00.0050.13313.27
5.3.290.0150.17012.60
5.3.280.0070.16712.51
5.3.270.0070.16212.52
5.3.260.0150.16012.40
5.3.250.0080.15212.56
5.3.240.0030.14312.53
5.3.230.0100.15312.44
5.3.220.0100.17712.32
5.3.210.0120.16812.48
5.3.200.0100.13712.36
5.3.190.0050.15512.46
5.3.180.0070.17012.48
5.3.170.0080.13912.41
5.3.160.0030.14212.40
5.3.150.0080.16612.50
5.3.140.0070.17612.48
5.3.130.0120.16312.49
5.3.120.0120.16112.48
5.3.110.0100.16412.43
5.3.100.0120.15612.22
5.3.90.0100.16412.24
5.3.80.0130.14712.07
5.3.70.0050.16712.03
5.3.60.0070.16712.28
5.3.50.0030.16512.10
5.3.40.0080.16312.06
5.3.30.0030.19012.19
5.3.20.0070.16612.02
5.3.10.0070.13911.79
5.3.00.0150.16211.96
5.2.170.0040.13210.49
5.2.160.0050.14210.47
5.2.150.0030.14110.54
5.2.140.0050.15510.62
5.2.130.0030.13910.43
5.2.120.0020.16010.48
5.2.110.0020.17010.51
5.2.100.0110.16210.47
5.2.90.0100.14710.53
5.2.80.0070.14210.55
5.2.70.0070.16510.48
5.2.60.0030.13210.47
5.2.50.0000.16210.46
5.2.40.0050.13510.43
5.2.30.0030.15910.38
5.2.20.0030.15610.42
5.2.10.0050.12410.42
5.2.00.0020.13710.35
5.1.60.0000.1419.97
5.1.50.0070.1499.99
5.1.40.0020.1449.96
5.1.30.0020.13210.15
5.1.20.0030.15310.17
5.1.10.0070.14810.01
5.1.00.0050.16510.07
5.0.50.0020.2539.47
5.0.40.0030.2429.47
5.0.30.0030.2259.47
5.0.20.0100.2219.47
5.0.10.0070.2049.47
5.0.00.0070.2639.47
4.4.90.0030.2039.47
4.4.80.0050.2319.47
4.4.70.0020.2109.47
4.4.60.0030.2319.47
4.4.50.0020.2449.47
4.4.40.0000.2199.47
4.4.30.0020.2269.47
4.4.20.0050.2169.47
4.4.10.0020.2359.47
4.4.00.0020.2119.47
4.3.110.0070.2079.47
4.3.100.0020.2229.47
4.3.90.0020.2319.47
4.3.80.0000.2409.47
4.3.70.0080.2399.47
4.3.60.0100.2269.47
4.3.50.0050.2499.47
4.3.40.0020.2149.47
4.3.30.0020.2089.47
4.3.20.0000.2149.47
4.3.10.0020.2259.47
4.3.00.0020.2079.47

preferences:
37.28 ms | 401 KiB | 5 Q