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 ) );

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.40.0120.00318.77
8.3.30.0070.00718.93
8.3.20.0060.00320.33
8.3.10.0080.00021.69
8.3.00.0030.00519.15
8.2.170.0040.01122.96
8.2.160.0070.00720.52
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00019.66
8.2.110.0100.00020.99
8.2.100.0090.00317.63
8.2.90.0060.00319.05
8.2.80.0040.00417.97
8.2.70.0040.00417.75
8.2.60.0040.00418.04
8.2.50.0000.00818.07
8.2.40.0050.00319.82
8.2.30.0000.00817.94
8.2.20.0040.00417.83
8.2.10.0040.00418.14
8.2.00.0040.00417.75
8.1.270.0090.00020.25
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00623.96
8.1.230.0060.00620.69
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0040.00417.35
8.1.190.0040.00417.35
8.1.180.0050.00318.10
8.1.170.0060.00320.50
8.1.160.0000.00721.85
8.1.150.0000.00718.77
8.1.140.0040.00417.54
8.1.130.0000.00717.86
8.1.120.0050.00217.45
8.1.110.0040.00417.48
8.1.100.0040.00417.45
8.1.90.0000.00717.48
8.1.80.0040.00417.43
8.1.70.0000.00717.55
8.1.60.0050.00317.79
8.1.50.0030.00517.53
8.1.40.0000.00817.56
8.1.30.0000.00817.70
8.1.20.0000.00817.78
8.1.10.0000.00817.55
8.1.00.0000.00817.61
8.0.300.0000.00718.77
8.0.290.0050.00216.88
8.0.280.0030.00318.30
8.0.270.0070.00017.18
8.0.260.0000.00617.21
8.0.250.0000.00717.09
8.0.240.0060.00017.00
8.0.230.0000.00817.03
8.0.220.0000.00717.02
8.0.210.0030.00316.98
8.0.200.0040.00417.03
8.0.190.0040.00417.04
8.0.180.0040.00416.83
8.0.170.0000.00816.99
8.0.160.0070.00016.93
8.0.150.0030.00317.02
8.0.140.0040.00416.98
8.0.130.0030.00313.38
8.0.120.0000.00816.83
8.0.110.0040.00416.89
8.0.100.0040.00416.95
8.0.90.0000.00716.79
8.0.80.0110.00617.01
8.0.70.0030.00516.95
8.0.60.0000.00716.84
8.0.50.0000.00716.97
8.0.30.0160.01117.25
8.0.20.0080.01317.40
8.0.10.0000.00717.11
8.0.00.0110.00717.05
7.4.330.0060.00015.14
7.4.320.0040.00416.61
7.4.300.0000.00616.72
7.4.290.0000.00716.83
7.4.280.0000.00816.83
7.4.270.0070.00016.72
7.4.260.0000.00716.80
7.4.250.0030.00616.60
7.4.240.0000.00716.78
7.4.230.0000.00716.83
7.4.220.0100.01616.77
7.4.210.0030.01016.77
7.4.200.0000.00716.61
7.4.160.0090.00616.43
7.4.150.0060.01217.40
7.4.140.0090.00917.86
7.4.130.0120.00516.58
7.4.120.0080.00816.77
7.4.110.0040.01516.63
7.4.100.0000.02316.49
7.4.90.0070.01016.73
7.4.80.0060.01219.39
7.4.70.0060.01316.73
7.4.60.0000.01916.54
7.4.50.0080.00016.86
7.4.40.0100.00616.65
7.4.30.0130.01016.60
7.4.00.0030.01315.12
7.3.330.0000.00713.26
7.3.320.0070.00713.40
7.3.310.0040.00416.31
7.3.300.0030.00316.45
7.3.290.0050.00816.42
7.3.280.0070.01116.43
7.3.270.0130.00717.40
7.3.260.0120.00916.88
7.3.250.0120.00616.52
7.3.240.0120.01216.62
7.3.230.0090.00916.63
7.3.210.0100.00716.65
7.3.200.0190.00019.39
7.3.190.0110.00416.60
7.3.180.0090.00616.45
7.3.170.0130.00916.43
7.3.160.0050.01116.63
7.2.330.0040.01516.76
7.2.320.0140.00716.80
7.2.310.0040.01216.92
7.2.300.0130.00616.74
7.2.290.0040.01416.97
7.2.00.0000.01719.79
7.1.200.0060.00616.08
7.1.100.0000.01517.96
7.1.70.0030.00717.30
7.1.60.0110.01519.46
7.1.50.0190.00317.18
7.1.00.0030.07722.46
7.0.200.0430.01014.75
7.0.140.0100.06321.95
7.0.60.0070.08719.88
7.0.50.0070.05717.88
7.0.40.0070.04320.25
7.0.30.0230.05320.25
7.0.20.0370.07720.07
7.0.10.0270.07720.12
7.0.00.0070.08020.11
5.6.280.0030.07320.90
5.6.210.0130.07020.50
5.6.200.0030.08018.27
5.6.190.0030.08320.77
5.6.180.0230.06020.49
5.6.170.0500.07020.55
5.6.160.0000.06020.47
5.6.150.0070.05018.23
5.6.140.0030.04018.17
5.6.130.0030.07718.18
5.6.120.0130.08021.10
5.6.110.0230.07321.12
5.6.100.0070.08021.12
5.6.90.0030.06321.11
5.6.80.0070.08320.45
5.6.70.0270.07020.41
5.5.350.0030.06720.35
5.5.340.0030.04317.94
5.5.330.0100.04020.35
5.5.320.0030.05320.27
5.5.310.0270.07720.34
5.5.300.0070.06717.98
5.5.290.0170.04718.07
5.5.280.0070.08720.88
5.5.270.0100.05020.74
5.5.260.0130.07020.73
5.5.250.0070.08720.58
5.5.240.0000.08020.32
5.4.450.0270.07319.58
5.4.440.0800.06319.59
5.4.430.0930.04719.38
5.4.420.0900.05319.46
5.4.410.0700.06019.43
5.4.400.0230.04718.71
5.4.390.0200.05018.46
5.4.380.0230.05318.79
5.4.370.0130.06018.75
5.4.360.0130.05718.44
5.4.350.0130.05718.75
5.4.340.0200.04718.77
5.4.320.0130.05718.75
5.4.310.0130.06318.84
5.4.300.0170.05018.70
5.4.290.0200.04718.76
5.4.280.0170.04718.70
5.4.270.0170.05318.72
5.4.260.0270.04718.52
5.4.250.0170.05718.52
5.4.240.0200.05018.77
5.4.230.0170.05018.82
5.4.220.0170.05018.69
5.4.210.0270.04318.57
5.4.200.0130.05316.59
5.4.190.0600.05018.78
5.4.180.0170.05318.76
5.4.170.0130.06318.69
5.4.160.0070.06718.57
5.4.150.0030.06318.67
5.4.140.0130.05316.23
5.4.130.0130.05016.25
5.4.120.0170.05016.37
5.4.110.0100.05316.21
5.4.100.0200.04316.17
5.4.90.0170.05016.35
5.4.80.0170.05016.44
5.4.70.0100.05716.25
5.4.60.0200.04316.23
5.4.50.0200.04316.20
5.4.40.0200.04716.30
5.4.30.0130.05716.26
5.4.20.0100.05316.30
5.4.10.0230.04016.29
5.4.00.0170.04715.79
5.3.290.0030.06314.71
5.3.280.0130.05014.62
5.3.270.0070.06314.89
5.3.260.0130.05314.80
5.3.250.0270.04314.65
5.3.240.0170.05014.66
5.3.230.0170.05014.70
5.3.220.0300.03714.67
5.3.210.0230.05014.74
5.3.200.0170.04714.56
5.3.190.0170.05014.57
5.3.180.0200.05714.62
5.3.170.0270.04314.60
5.3.160.0100.05314.85
5.3.150.0170.05314.54
5.3.140.0170.04714.75
5.3.130.0130.05714.64
5.3.120.0200.04714.59
5.3.110.0200.05714.73
5.3.100.0270.04014.13
5.3.90.0170.05014.18
5.3.80.0170.04714.02
5.3.70.0200.06714.30
5.3.60.0230.04314.02
5.3.50.0230.04714.08
5.3.40.0070.05714.15
5.3.30.0100.05014.03
5.3.20.0270.04713.73
5.3.10.0100.05013.70
5.3.00.0170.04713.70
5.2.170.0170.03711.27
5.2.160.0070.04311.27
5.2.150.0230.03311.28
5.2.140.0100.04311.12
5.2.130.0100.04011.31
5.2.120.0130.03711.23
5.2.110.0130.04011.12
5.2.100.0170.03711.21
5.2.90.0100.04011.20
5.2.80.0170.04011.32
5.2.70.0100.04711.38
5.2.60.0130.04011.04
5.2.50.0130.04011.12
5.2.40.0130.04011.01
5.2.30.0200.03011.03
5.2.20.0200.03310.95
5.2.10.0070.04010.88
5.2.00.0030.04310.70
5.1.60.0100.03010.09
5.1.50.0130.0309.99
5.1.40.0070.03710.08
5.1.30.0170.03010.55
5.1.20.0100.03310.49
5.1.10.0130.03310.20
5.1.00.0100.03710.20
5.0.50.0130.0208.54
5.0.40.0030.0308.54
5.0.30.0030.0438.25
5.0.20.0070.0278.22
5.0.10.0030.0308.31
5.0.00.0100.0408.20
4.4.90.0000.0405.84
4.4.80.0100.0205.93
4.4.70.0100.0205.87
4.4.60.0070.0235.82
4.4.50.0070.0235.83
4.4.40.0030.0435.83
4.4.30.0070.0235.90
4.4.20.0030.0275.89
4.4.10.0070.0235.89
4.4.00.0130.0305.85
4.3.110.0100.0205.77
4.3.100.0070.0235.77
4.3.90.0000.0275.77
4.3.80.0100.0335.82
4.3.70.0070.0235.76
4.3.60.0000.0305.73
4.3.50.0100.0235.76
4.3.40.0070.0335.72
4.3.30.0070.0234.48
4.3.20.0030.0234.56
4.3.10.0030.0204.46
4.3.00.0000.0236.96

preferences:
47.45 ms | 400 KiB | 5 Q