3v4l.org

run code in 300+ PHP versions simultaneously
<?php function _deep_replace( $search, $subject ) { $subject = (string) $subject; $count = 1; while ( $count ) { $subject = str_replace( $search, '', $subject, $count ); } return $subject; } $foo = '*123123123ABCABCABC*'; var_dump( str_replace( '123ABC', '', $foo ) ); var_dump( _deep_replace( '123ABC', $foo ) ); var_dump( preg_replace('/123ABC+/', '', $foo ) ); var_dump( strtr( $foo, array( '123ABC' => '' ) ) );

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.0140.00716.75
8.3.50.0090.00922.18
8.3.40.0180.00418.98
8.3.30.0070.01018.91
8.3.20.0080.00020.33
8.3.10.0070.00021.87
8.3.00.0000.00919.27
8.2.180.0100.01016.75
8.2.170.0110.00422.96
8.2.160.0090.00620.47
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0050.00226.16
8.2.120.0040.00419.66
8.2.110.0060.00321.00
8.2.100.0040.00817.63
8.2.90.0000.00818.92
8.2.80.0000.00917.97
8.2.70.0090.00017.72
8.2.60.0000.00818.04
8.2.50.0090.00018.07
8.2.40.0030.00619.95
8.2.30.0040.00418.04
8.2.20.0030.00517.64
8.2.10.0000.00818.06
8.2.00.0040.00417.93
8.1.280.0060.01025.92
8.1.270.0080.00020.52
8.1.260.0000.00726.35
8.1.250.0050.00228.09
8.1.240.0040.00423.97
8.1.230.0060.00618.97
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0040.00417.35
8.1.190.0000.00817.22
8.1.180.0040.00418.10
8.1.170.0050.00320.42
8.1.160.0000.00821.94
8.1.150.0000.01118.84
8.1.140.0000.00717.45
8.1.130.0080.00017.84
8.1.120.0050.00217.59
8.1.110.0040.00417.43
8.1.100.0040.00417.41
8.1.90.0000.00717.43
8.1.80.0040.00417.54
8.1.70.0070.00017.48
8.1.60.0030.00617.59
8.1.50.0080.00017.70
8.1.40.0000.00917.55
8.1.30.0030.00617.82
8.1.20.0070.00017.72
8.1.10.0050.00317.56
8.1.00.0070.00017.63
8.0.300.0030.00618.77
8.0.290.0030.00516.72
8.0.280.0030.00318.39
8.0.270.0080.00017.25
8.0.260.0000.00617.13
8.0.250.0030.00317.05
8.0.240.0070.00017.03
8.0.230.0000.00817.01
8.0.220.0070.00016.86
8.0.210.0000.00716.94
8.0.200.0000.00717.04
8.0.190.0040.00417.00
8.0.180.0000.00717.02
8.0.170.0030.00516.87
8.0.160.0040.00416.87
8.0.150.0000.00716.96
8.0.140.0000.00716.98
8.0.130.0030.00313.35
8.0.120.0060.00316.94
8.0.110.0000.00716.88
8.0.100.0080.00016.90
8.0.90.0000.00816.86
8.0.80.0000.01816.91
8.0.70.0000.00816.96
8.0.60.0040.00416.87
8.0.50.0040.00416.94
8.0.30.0120.01117.20
8.0.20.0080.01217.40
8.0.10.0040.00417.13
8.0.00.0070.01016.87
7.4.330.0000.00515.12
7.4.320.0030.00316.72
7.4.300.0000.00616.82
7.4.290.0080.00016.69
7.4.280.0000.00816.70
7.4.270.0070.00016.71
7.4.260.0000.00716.55
7.4.250.0030.00616.80
7.4.240.0050.00216.63
7.4.230.0070.00016.64
7.4.220.0070.01816.66
7.4.210.0110.00416.73
7.4.200.0000.00716.73
7.4.160.0140.00316.41
7.4.150.0070.01117.40
7.4.140.0110.00817.86
7.4.130.0090.00816.80
7.4.120.0090.00716.74
7.4.110.0110.01016.72
7.4.100.0040.01316.82
7.4.90.0110.00716.68
7.4.80.0120.00619.39
7.4.70.0110.00616.59
7.4.60.0130.00316.74
7.4.50.0000.00716.57
7.4.40.0000.02216.86
7.4.30.0070.01016.67
7.4.00.0100.00715.06
7.3.330.0070.00013.43
7.3.320.0090.00613.38
7.3.310.0000.00716.45
7.3.300.0030.00316.41
7.3.290.0070.00716.42
7.3.280.0100.01016.42
7.3.270.0130.00917.40
7.3.260.0090.00916.66
7.3.250.0160.00116.61
7.3.240.0140.01016.76
7.3.230.0100.00716.54
7.3.210.0090.00616.64
7.3.200.0060.01319.39
7.3.190.0030.01316.49
7.3.180.0120.00916.68
7.3.170.0080.00816.65
7.3.160.0090.00916.41
7.3.120.0100.01015.21
7.3.110.0070.01014.78
7.3.100.0060.00914.91
7.3.90.0120.00314.84
7.3.80.0040.00415.06
7.3.70.0030.01314.75
7.3.60.0040.01114.94
7.3.50.0070.00714.87
7.3.40.0030.01014.98
7.3.30.0070.00714.68
7.3.20.0030.00717.00
7.3.10.0060.00916.87
7.3.00.0060.00916.90
7.2.330.0090.01216.74
7.2.320.0110.02216.82
7.2.310.0110.00616.76
7.2.300.0060.01616.86
7.2.290.0100.00716.75
7.2.250.0030.01715.01
7.2.240.0030.01315.00
7.2.230.0090.00615.02
7.2.220.0080.00315.41
7.2.210.0120.00415.23
7.2.200.0070.00715.17
7.2.190.0000.01415.24
7.2.180.0040.01215.16
7.2.170.0070.00715.26
7.2.00.0070.01119.39
7.1.330.0040.01115.99
7.1.320.0100.00016.16
7.1.310.0090.00615.95
7.1.300.0000.01516.06
7.1.290.0080.00815.90
7.1.280.0030.01016.05
7.1.270.0030.01116.00
7.1.260.0060.00915.92
7.1.100.0030.00618.16
7.1.70.0060.00917.21
7.1.60.0100.01319.46
7.1.50.0120.00317.11
7.1.00.0030.07722.49
7.0.200.0450.00314.69
7.0.140.0000.05722.00
7.0.60.0130.07720.09
7.0.50.0100.07717.88
7.0.40.0130.05020.42
7.0.30.0330.06720.26
7.0.20.0270.08020.05
7.0.10.0330.08320.24
7.0.00.0070.07720.25
5.6.280.0070.07021.12
5.6.210.0100.08320.52
5.6.200.0170.07318.26
5.6.190.0030.04320.46
5.6.180.0270.03020.45
5.6.170.0270.07320.50
5.6.160.0070.04720.51
5.6.150.0070.07318.27
5.6.140.0030.08318.18
5.6.130.0030.08318.23
5.6.120.0130.05321.04
5.6.110.0170.07321.06
5.6.100.0070.04321.13
5.6.90.0100.04321.01
5.6.80.0000.07720.54
5.6.70.0200.07020.44
5.5.350.0070.07720.38
5.5.340.0070.07717.96
5.5.330.0100.08020.42
5.5.320.0000.08720.21
5.5.310.0370.06720.51
5.5.300.0130.06717.94
5.5.290.0030.07318.04
5.5.280.0070.03720.79
5.5.270.0030.09020.87
5.5.260.0030.07020.80
5.5.250.0130.07020.62
5.5.240.0070.07020.28
5.4.450.0000.06319.52
5.4.440.0030.06719.31
5.4.430.0000.06019.48
5.4.420.0070.06719.57
5.4.410.0030.08319.41
5.4.400.0000.04319.00
5.4.390.0070.06719.24
5.4.380.0030.06019.24
5.4.370.0030.07319.09
5.4.360.0100.05718.86
5.4.350.0030.07019.16
5.4.340.0000.07018.95
5.4.320.0030.08019.08
5.4.310.0070.07318.95
5.4.300.0030.06719.18
5.4.290.0100.07019.08
5.4.280.0030.05019.15
5.4.270.0030.04319.26
5.4.260.0070.06718.99
5.4.250.0030.07318.86
5.4.240.0070.05319.22
5.4.230.0100.05319.15
5.4.220.0000.07319.19
5.4.210.0000.04319.32
5.4.200.0000.08019.22
5.4.190.0000.05018.91
5.4.180.0070.07718.95
5.4.170.0030.06318.93
5.4.160.0130.06019.04
5.4.150.0070.05719.21
5.4.140.0070.07316.36
5.4.130.0000.07316.40
5.4.120.0000.04316.55
5.4.110.0030.08016.42
5.4.100.0070.07316.51
5.4.90.0000.07016.27
5.4.80.0030.07716.31
5.4.70.0130.06016.48
5.4.60.0030.06316.49
5.4.50.0070.06316.51
5.4.40.0070.07316.42
5.4.30.0030.07016.16
5.4.20.0030.04316.32
5.4.10.0030.07316.43
5.4.00.0070.04315.79
5.3.290.0100.07314.73
5.3.280.0000.05714.51
5.3.270.0030.05014.76
5.3.260.0030.08014.53
5.3.250.0070.07314.53
5.3.240.0000.08014.54
5.3.230.0070.04014.59
5.3.220.0030.06314.55
5.3.210.0070.05314.47
5.3.200.0000.08014.62
5.3.190.0030.07014.50
5.3.180.0100.05714.78
5.3.170.0000.06314.48
5.3.160.0030.06714.47
5.3.150.0030.04314.66
5.3.140.0000.04014.52
5.3.130.0000.06314.55
5.3.120.0030.07714.54
5.3.110.0130.03714.55
5.3.100.0000.08014.01
5.3.90.0070.05313.93
5.3.80.0000.07713.92
5.3.70.0030.06714.13
5.3.60.0000.04714.00
5.3.50.0030.04013.95
5.3.40.0030.07013.87
5.3.30.0070.03713.91
5.3.20.0130.03013.74
5.3.10.0000.07013.71
5.3.00.0030.05013.68
5.2.170.0030.06012.13
5.2.160.0100.03312.13
5.2.150.0030.03312.13
5.2.140.0130.02312.13
5.2.130.0000.03312.13
5.2.120.0070.02712.13
5.2.110.0000.05012.13
5.2.100.0070.05712.13
5.2.90.0030.05312.13
5.2.80.0030.06012.13
5.2.70.0030.06312.13
5.2.60.0030.06312.13
5.2.50.0100.02712.13
5.2.40.0000.05712.13
5.2.30.0070.06012.13
5.2.20.0000.06312.13
5.2.10.0070.02712.92
5.2.00.0000.03312.92
5.1.60.0100.04312.92
5.1.50.0030.04712.92
5.1.40.0000.05012.92
5.1.30.0000.06012.92
5.1.20.0000.05712.92
5.1.10.0030.05712.92
5.1.00.0070.04712.92
5.0.50.0030.03313.05
5.0.40.0000.02013.06
5.0.30.0000.07013.23
5.0.20.0030.04313.59
5.0.10.0000.04013.79
5.0.00.0030.06713.79
4.4.90.0030.03712.13
4.4.80.0000.03012.13
4.4.70.0030.03312.13
4.4.60.0070.03312.61
4.4.50.0000.03712.89
4.4.40.0000.05312.92
4.4.30.0000.03712.92
4.4.20.0030.03712.92
4.4.10.0030.03712.92
4.4.00.0000.02713.05
4.3.110.0070.03013.06
4.3.100.0000.02713.23
4.3.90.0030.03713.59
4.3.80.0070.05313.79
4.3.70.0030.03313.99
4.3.60.0100.01714.27
4.3.50.0070.03014.43
4.3.40.0030.03714.43
4.3.30.0000.04014.43
4.3.20.0030.03314.43
4.3.10.0000.02714.43
4.3.00.0000.02014.43

preferences:
36.83 ms | 401 KiB | 5 Q