3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startTimeOne = microtime(true); for ($i = 0; $i <= 10000; $i++) { str_replace('-', '+', 'my-name-is-am-and-i-like-trains'); } $endTimeOne = microtime(true); for ($j = 0; $j <= 10000; $j++) { str_replace('-', '+', 'foo-bar'); } $endTimeTwo = microtime(true); for ($j = 0; $j <= 10000; $j++) { preg_replace('#-#', '+', 'my-name-is-am-and-i-like-trains'); } $endTimeThree = microtime(true); for ($j = 0; $j <= 10000; $j++) { preg_replace('#-#', '+', 'foo-bar'); } $endTimeFour = microtime(true); echo ($endTimeOne - $startTimeOne) * 1000 . "\n"; echo ($endTimeTwo - $endTimeOne) * 1000 . "\n"; echo ($endTimeThree - $endTimeTwo) * 1000 . "\n"; echo ($endTimeFour - $endTimeThree) * 1000;

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.0090.02815.15
7.3.120.0090.02414.88
7.3.110.0080.02314.99
7.3.100.0090.01814.94
7.3.90.0070.02314.92
7.3.80.0100.01915.11
7.3.70.0020.02315.08
7.3.60.0030.02315.05
7.3.50.0030.02214.95
7.3.40.0060.02114.76
7.3.30.0080.01814.92
7.3.20.0050.02116.85
7.3.10.0070.01916.86
7.3.00.0040.02216.68
7.2.250.0030.02915.33
7.2.240.0100.02615.22
7.2.230.0080.02415.20
7.2.220.0080.02715.03
7.2.210.0060.02415.23
7.2.200.0060.02415.27
7.2.190.0050.02115.32
7.2.180.0020.02615.17
7.2.170.0060.02115.10
7.2.160.0030.01715.00
7.2.150.0030.02117.13
7.2.140.0030.02817.13
7.2.130.0100.02017.07
7.2.120.0040.02116.99
7.2.110.0070.01717.22
7.2.100.0090.01817.18
7.2.90.0110.01817.16
7.2.80.0000.02417.14
7.2.70.0060.01917.02
7.2.60.0000.02117.21
7.2.50.0070.02316.96
7.2.40.0070.02417.18
7.2.30.0040.02116.95
7.2.20.0150.01217.09
7.2.10.0070.02116.93
7.2.00.0070.01918.30
7.1.330.0040.02415.72
7.1.320.0050.02415.98
7.1.310.0030.02615.96
7.1.300.0040.02515.80
7.1.290.0050.02415.91
7.1.280.0070.02315.86
7.1.270.0060.02115.97
7.1.260.0060.02516.00
7.1.250.0060.02615.84
7.1.70.0070.02617.43
7.1.60.0070.03219.86
7.1.50.0030.02317.14
7.1.00.0030.08722.52
7.0.200.0380.01315.14
7.0.110.0500.09319.91
7.0.100.0670.08019.93
7.0.90.0470.09719.93
7.0.80.0600.06320.03
7.0.70.0630.08020.02
7.0.60.0600.09319.92
7.0.50.0630.05020.18
7.0.40.0070.09020.00
7.0.30.0170.07020.21
7.0.20.0070.09320.10
7.0.10.0130.08719.90
7.0.00.0130.08320.19
5.6.280.0130.09720.90
5.6.260.0100.10720.59
5.6.250.0200.06020.62
5.6.240.0070.11020.67
5.6.230.0100.11320.52
5.6.220.0070.11020.63
5.6.210.0100.09720.35
5.6.200.0070.10021.18
5.6.190.0030.09321.04
5.6.180.0170.07020.98
5.6.170.0100.10721.05
5.6.160.0070.11021.10
5.6.150.0000.09320.99
5.6.140.0130.10020.87
5.6.130.0070.10320.91
5.6.120.0200.09320.91
5.6.110.0070.10320.88
5.6.100.0130.10721.06
5.6.90.0030.09721.15
5.6.80.0130.08720.45
5.6.70.0070.10720.29
5.6.60.0100.08720.40
5.6.50.0230.09720.48
5.6.40.0200.09320.24
5.6.30.0130.09720.39
5.6.20.0070.09720.59
5.6.10.0170.10320.37
5.6.00.0030.11020.35
5.5.380.0070.11020.36
5.5.370.0000.11720.42
5.5.360.0100.10320.27
5.5.350.0070.10320.44
5.5.340.0130.09720.73
5.5.330.0100.10020.73
5.5.320.0030.12020.86
5.5.310.0030.10720.63
5.5.300.0070.07720.91
5.5.290.0100.08320.94
5.5.280.0000.06720.77
5.5.270.0100.11020.91
5.5.260.0170.08720.89
5.5.250.0070.10020.73
5.5.240.0030.10320.38
5.5.230.0000.11720.03
5.5.220.0130.10020.18
5.5.210.0070.10320.17
5.5.200.0100.08020.19
5.5.190.0000.10720.08
5.5.180.0100.10320.17
5.5.160.0100.11320.17
5.5.150.0100.10720.14
5.5.140.0100.09320.29
5.5.130.0030.09720.21
5.5.120.0170.09320.24
5.5.110.0070.10020.04
5.5.100.0100.10019.96
5.5.90.0100.10020.20
5.5.80.0100.10320.18
5.5.70.0200.09320.18
5.5.60.0170.09020.14
5.5.50.0130.10720.12
5.5.40.0070.10719.96
5.5.30.0030.10019.93
5.5.20.0030.10720.00
5.5.10.0100.10020.14
5.5.00.0200.09720.16
5.4.450.0100.07319.50
5.4.440.0070.10319.30
5.4.430.0000.10319.35
5.4.420.0070.09719.30
5.4.410.0130.08019.36
5.4.400.0100.07719.12
5.4.390.0170.10019.17
5.4.380.0070.10019.02
5.4.370.0170.09319.01
5.4.360.0130.09019.16
5.4.350.0030.11019.00
5.4.340.0130.10018.92
5.4.320.0000.11019.03
5.4.310.0070.10318.95
5.4.300.0130.09719.07
5.4.290.0070.10718.93
5.4.280.0130.10018.95
5.4.270.0030.09719.00
5.4.260.0070.10719.11
5.4.250.0100.10018.98
5.4.240.0200.09319.07
5.4.230.0130.08719.02
5.4.220.0200.08318.99
5.4.210.0130.10019.11
5.4.200.0070.10318.95
5.4.190.0030.07018.99
5.4.180.0100.10019.26
5.4.170.0030.07319.06
5.4.160.0070.09018.97
5.4.150.0030.10019.25
5.4.140.0070.09016.22
5.4.130.0070.10316.20
5.4.120.0070.09716.14
5.4.110.0030.10316.48
5.4.100.0000.09716.50
5.4.90.0100.09016.40
5.4.80.0070.10316.57
5.4.70.0130.08016.51
5.4.60.0100.09716.47
5.4.50.0030.10016.34
5.4.40.0130.08716.26
5.4.30.0100.09016.39
5.4.20.0170.08316.15
5.4.10.0000.10716.20
5.4.00.0100.09715.91
5.3.290.0070.10714.70
5.3.280.0000.10714.43
5.3.270.0130.09714.52
5.3.260.0230.08314.68
5.3.250.0170.09314.56
5.3.240.0070.10714.63
5.3.230.0100.10314.60
5.3.220.0000.10714.50
5.3.210.0200.10014.44
5.3.200.0030.10314.57
5.3.190.0000.11314.67
5.3.180.0070.10314.42
5.3.170.0170.09014.67
5.3.160.0130.08314.46
5.3.150.0070.11014.57
5.3.140.0030.10314.46
5.3.130.0030.10314.55
5.3.120.0100.10314.48
5.3.110.0100.09014.46
5.3.100.0100.09714.15
5.3.90.0070.09714.14
5.3.80.0030.11713.96
5.3.70.0070.10314.04
5.3.60.0130.09713.90
5.3.50.0100.10013.89
5.3.40.0030.10714.03
5.3.30.0100.08313.79
5.3.20.0130.08713.76
5.3.10.0130.09713.54
5.3.00.0070.08313.75
5.2.170.0070.09711.82
5.2.160.0030.07311.82
5.2.150.0030.08311.82
5.2.140.0000.08711.82
5.2.130.0100.08311.82
5.2.120.0070.08311.82
5.2.110.0030.08711.82
5.2.100.0000.09011.82
5.2.90.0100.08311.82
5.2.80.0030.08311.82
5.2.70.0030.08711.82
5.2.60.0130.08011.82
5.2.50.0100.08011.82
5.2.40.0070.09011.82
5.2.30.0070.08711.82
5.2.20.0130.07311.82
5.2.10.0070.07711.82
5.2.00.0030.09311.82
5.1.60.0100.07011.82
5.1.50.0070.08011.82
5.1.40.0070.08311.82
5.1.30.0030.08711.82
5.1.20.0100.07311.82
5.1.10.0030.08011.82
5.1.00.0030.05011.82
5.0.50.0000.07711.82
5.0.40.0030.08011.82
5.0.30.0030.08011.82
5.0.20.0070.08011.82
5.0.10.0000.08011.82
5.0.00.0070.09311.82
4.4.90.0000.07311.82
4.4.80.0030.06311.82
4.4.70.0070.07011.82
4.4.60.0000.07711.82
4.4.50.0070.06711.82
4.4.40.0030.07711.82
4.4.30.0000.07711.82
4.4.20.0070.06011.82
4.4.10.0000.08011.82
4.4.00.0030.08711.82
4.3.110.0030.06011.82
4.3.100.0070.06311.82
4.3.90.0000.06711.82
4.3.80.0030.08311.82
4.3.70.0000.04711.82
4.3.60.0030.07011.82
4.3.50.0000.07311.82
4.3.40.0070.08011.82
4.3.30.0030.07011.82
4.3.20.0030.06711.82
4.3.10.0070.07011.82
4.3.00.0000.07011.82

preferences:
36.33 ms | 403 KiB | 5 Q