3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = 'React/Controller/Website/User'; $s = microtime(true); for ($i = 0; $i < 1000; $i++) $result = strtr($var, '/', '_'); printf('%.09f', microtime(true) - $s); var_dump($result); echo "\n"; $s = microtime(true); for ($i = 0; $i < 1000; $i++) $result = str_replace('/', '_', $var); printf('%.09f', microtime(true) - $s); var_dump($result);

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.10.0030.01414.95
7.4.00.0100.00314.82
7.3.130.0110.00714.58
7.3.120.0060.01014.96
7.3.110.0080.01114.88
7.3.100.0060.01014.90
7.3.90.0080.00614.70
7.3.80.0030.00914.76
7.3.70.0050.00914.90
7.3.60.0050.01014.80
7.3.50.0030.01214.82
7.3.40.0020.00914.87
7.3.30.0070.00514.71
7.3.20.0020.01016.64
7.3.10.0080.00716.72
7.3.00.0060.00816.77
7.2.260.0030.01014.66
7.2.250.0100.00815.06
7.2.240.0070.00914.93
7.2.230.0050.01014.99
7.2.220.0050.01015.18
7.2.210.0070.00715.18
7.2.200.0020.01314.90
7.2.190.0070.00815.07
7.2.180.0070.00614.95
7.2.170.0000.01315.08
7.2.160.0100.00315.02
7.2.150.0070.00917.02
7.2.140.0070.00616.68
7.2.130.0050.00816.78
7.2.120.0060.01116.89
7.2.110.0090.00516.91
7.2.100.0060.01016.97
7.2.90.0110.00117.05
7.2.80.0040.00916.80
7.2.70.0100.00516.85
7.2.60.0020.01416.76
7.2.50.0100.00316.75
7.2.40.0050.00816.85
7.2.30.0070.00917.03
7.2.20.0100.00716.75
7.2.10.0070.00916.99
7.2.00.0020.01417.77
7.1.330.0020.01115.79
7.1.320.0080.00715.84
7.1.310.0050.00615.68
7.1.300.0050.00915.89
7.1.290.0020.01315.84
7.1.280.0020.01215.84
7.1.270.0030.01115.76
7.1.260.0040.00915.87
7.1.250.0070.00915.79
7.1.240.0060.00815.83
7.1.230.0070.00815.78
7.1.220.0050.00715.57
7.1.210.0070.00715.79
7.1.200.0050.01015.85
7.1.190.0030.01115.73
7.1.180.0110.00215.69
7.1.170.0070.00715.67
7.1.160.0090.00515.88
7.1.150.0070.00715.77
7.1.140.0100.00615.79
7.1.130.0070.00715.77
7.1.120.0050.00715.86
7.1.110.0070.00815.81
7.1.100.0060.00815.93
7.1.90.0070.00715.93
7.1.80.0060.00715.62
7.1.70.0030.01016.28
7.1.60.0070.00917.09
7.1.50.0030.00916.29
7.1.40.0030.01015.76
7.1.30.0070.00815.71
7.1.20.0080.00515.82
7.1.10.0050.01115.73
7.1.00.0030.03318.01
7.0.330.0100.00515.32
7.0.320.0090.00715.43
7.0.310.0080.00615.25
7.0.300.0040.00615.36
7.0.290.0090.00615.42
7.0.280.0050.00815.35
7.0.270.0020.01115.29
7.0.260.0060.00615.29
7.0.250.0060.00815.53
7.0.240.0060.00915.33
7.0.230.0070.00715.43
7.0.220.0080.00815.32
7.0.210.0070.00515.38
7.0.200.0060.00615.89
7.0.190.0040.01115.27
7.0.180.0030.00715.41
7.0.170.0020.01115.38
7.0.160.0080.00715.41
7.0.150.0050.01015.36
7.0.140.0080.02517.71
7.0.130.0080.00715.48
7.0.120.0070.00915.54
7.0.110.0080.00615.46
7.0.100.0060.00615.57
7.0.90.0020.01115.41
7.0.80.0030.00815.60
7.0.70.0000.01115.39
7.0.60.0080.01816.92
7.0.50.0080.01816.30
7.0.40.0040.02315.63
7.0.30.0150.02815.63
7.0.20.0140.01715.79
7.0.10.0110.02715.66
7.0.00.0020.03615.77
5.6.400.0080.00614.39
5.6.390.0040.01414.26
5.6.380.0080.00814.52
5.6.370.0080.00614.47
5.6.360.0070.01014.37
5.6.350.0050.01014.31
5.6.340.0050.00914.16
5.6.330.0030.01114.37
5.6.320.0020.01314.14
5.6.310.0030.01214.11
5.6.300.0020.01114.20
5.6.290.0080.00614.26
5.6.280.0020.03316.53
5.6.270.0050.01214.40
5.6.260.0090.00714.43
5.6.250.0050.01014.29
5.6.240.0080.00614.49
5.6.230.0080.00614.28
5.6.220.0080.00814.36
5.6.210.0050.03616.56
5.6.200.0040.02215.73
5.6.190.0030.02216.44
5.6.180.0220.02916.29
5.6.170.0090.02216.28
5.6.160.0060.03416.62
5.6.150.0070.02115.57
5.6.140.0040.02215.68
5.6.130.0090.03015.65
5.6.120.0080.01716.47
5.6.110.0130.02916.54
5.6.100.0090.03016.52
5.6.90.0020.03616.51
5.6.80.0100.03216.43
5.6.70.0100.00414.31
5.6.60.0070.00914.28
5.6.50.0060.01214.34
5.6.40.0060.01014.22
5.6.30.0060.00814.41
5.6.20.0080.00614.43
5.6.10.0040.01114.36
5.6.00.0090.00714.24
5.5.380.0030.01214.44
5.5.370.0040.00914.42
5.5.360.0050.01114.05
5.5.350.0190.02316.38
5.5.340.0060.01915.45
5.5.330.0050.03616.34
5.5.320.0040.03416.31
5.5.310.0120.02916.26
5.5.300.0050.03315.51
5.5.290.0040.01915.53
5.5.280.0020.03116.61
5.5.270.0040.03316.52
5.5.260.0080.03216.46
5.5.250.0050.03616.39
5.5.240.0060.02016.18
5.5.230.0020.01514.14
5.5.220.0040.01213.96
5.5.210.0020.01614.31
5.5.200.0090.00614.30
5.5.190.0050.00914.04
5.5.180.0040.00814.27
5.5.170.0050.00614.09
5.5.160.0090.00714.30
5.5.150.0050.01014.18
5.5.140.0020.01414.05
5.5.130.0050.01314.17
5.5.120.0060.00814.25
5.5.110.0080.01014.19
5.5.100.0030.00914.28
5.5.90.0040.00914.16
5.5.80.0070.01014.22
5.5.70.0050.01014.23
5.5.60.0060.00514.19
5.5.50.0050.01214.31
5.5.40.0070.00714.21
5.5.30.0100.00514.38
5.5.20.0080.00714.10
5.5.10.0040.01114.07
5.5.00.0050.01014.19
5.4.450.0120.03114.44
5.4.440.0100.03214.64
5.4.430.0180.02314.52
5.4.420.0130.02414.63
5.4.410.0170.02714.56
5.4.400.0100.03214.45
5.4.390.0170.02414.47
5.4.380.0140.03014.44
5.4.370.0140.01714.45
5.4.360.0130.03014.46
5.4.350.0140.02114.38
5.4.340.0140.02514.45
5.4.330.0050.00612.18
5.4.320.0110.02514.35
5.4.310.0140.02814.37
5.4.300.0120.01614.40
5.4.290.0080.03214.39
5.4.280.0090.01814.38
5.4.270.0090.02514.39
5.4.260.0070.01814.48
5.4.250.0070.01914.38
5.4.240.0060.01914.37
5.4.230.0130.01814.32
5.4.220.0070.02114.43
5.4.210.0070.01914.33
5.4.200.0110.01514.45
5.4.190.0100.01814.32
5.4.180.0120.01614.40
5.4.170.0090.01714.32
5.4.160.0100.01514.42
5.4.150.0110.01514.44
5.4.140.0110.01613.58
5.4.130.0090.01413.53
5.4.120.0070.02013.49
5.4.110.0090.01613.42
5.4.100.0100.01613.51
5.4.90.0070.02113.37
5.4.80.0120.02113.50
5.4.70.0160.02813.55
5.4.60.0090.02013.51
5.4.50.0120.02813.50
5.4.40.0120.02613.55
5.4.30.0100.03113.49
5.4.20.0130.02413.45
5.4.10.0120.02113.45
5.4.00.0150.02713.34
5.3.290.0160.03012.92
5.3.280.0080.01612.85
5.3.270.0090.01812.89
5.3.260.0090.01812.88
5.3.250.0100.01712.83
5.3.240.0080.01612.84
5.3.230.0070.01812.87
5.3.220.0080.02012.88
5.3.210.0130.01612.85
5.3.200.0110.01812.85
5.3.190.0100.02012.82
5.3.180.0080.02112.90
5.3.170.0100.02712.81
5.3.160.0120.02912.85
5.3.150.0140.02112.81
5.3.140.0080.03112.85
5.3.130.0130.01712.83
5.3.120.0110.01812.85
5.3.110.0120.02212.81
5.3.100.0120.03112.65
5.3.90.0140.02712.63
5.3.80.0080.02612.67
5.3.70.0100.02612.63
5.3.60.0110.02012.69
5.3.50.0110.02012.64
5.3.40.0090.02812.61
5.3.30.0120.02612.67
5.3.20.0100.02812.51
5.3.10.0120.02912.55
5.3.00.0110.02912.54
5.2.170.0370.05013.11
5.2.160.0370.04713.11
5.2.150.0200.03713.11
5.2.140.0200.04013.11
5.2.130.0230.04313.11
5.2.120.0330.05013.11
5.2.110.0300.03013.11
5.2.100.0270.06013.11
5.2.90.0230.02713.11
5.2.80.0200.06313.11
5.2.70.0170.05713.11
5.2.60.0170.06713.11
5.2.50.0200.04313.11
5.2.40.0200.04013.11
5.2.30.0230.03713.11
5.2.20.0170.06013.11
5.2.10.0170.03313.11
5.2.00.0170.06313.11
5.1.60.0170.05013.11
5.1.50.0270.04013.11
5.1.40.0200.04313.11
5.1.30.0170.04013.11
5.1.20.0200.05313.11
5.1.10.0130.03013.11
5.1.00.0200.03713.11
5.0.50.0130.04713.11
5.0.40.0070.02713.11
5.0.30.0130.05713.11
5.0.20.0170.02013.11
5.0.10.0130.03013.11
5.0.00.0170.03313.11
4.4.90.0170.03013.11
4.4.80.0100.03713.11
4.4.70.0170.03313.11
4.4.60.0130.03013.11
4.4.50.0130.03313.11
4.4.40.0070.05313.11
4.4.30.0100.03713.11
4.4.20.0070.03013.11
4.4.10.0070.04013.11
4.4.00.0070.04013.11
4.3.110.0100.03713.11
4.3.100.0070.02713.11
4.3.90.0070.02713.11
4.3.80.0030.04713.11
4.3.70.0070.02313.11
4.3.60.0100.03713.11
4.3.50.0130.03713.11
4.3.40.0100.03013.11
4.3.30.0100.03313.11
4.3.20.0030.03013.11
4.3.10.0070.03313.11
4.3.00.0030.04013.11

preferences:
43.91 ms | 401 KiB | 5 Q