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( strstr( $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.0120.00316.75
8.3.50.0070.00718.10
8.3.40.0150.00619.04
8.3.30.0070.00719.20
8.3.20.0030.00620.19
8.3.10.0030.00621.75
8.3.00.0040.00419.51
8.2.180.0100.01018.41
8.2.170.0120.00622.96
8.2.160.0100.00320.47
8.2.150.0060.00324.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0050.00319.67
8.2.110.0100.00020.90
8.2.100.0000.01217.75
8.2.90.0040.00419.27
8.2.80.0030.00517.97
8.2.70.0080.00017.75
8.2.60.0030.00617.91
8.2.50.0080.00018.07
8.2.40.0040.00420.00
8.2.30.0050.00218.03
8.2.20.0000.00717.80
8.2.10.0030.00517.95
8.2.00.0040.00417.79
8.1.280.0190.00625.92
8.1.270.0050.00520.66
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00719.17
8.1.230.0060.00618.85
8.1.220.0000.00817.79
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0030.00617.36
8.1.180.0080.00018.10
8.1.170.0050.00320.52
8.1.160.0020.00521.89
8.1.150.0030.00618.86
8.1.140.0040.00417.61
8.1.130.0030.00317.79
8.1.120.0000.00717.59
8.1.110.0040.00417.56
8.1.100.0030.00317.54
8.1.90.0040.00417.57
8.1.80.0040.00417.54
8.1.70.0030.00317.61
8.1.60.0030.00617.65
8.1.50.0050.00317.68
8.1.40.0040.00417.58
8.1.30.0030.00517.82
8.1.20.0000.00817.84
8.1.10.0040.00417.71
8.1.00.0000.00817.54
8.0.300.0000.00718.77
8.0.290.0040.00416.88
8.0.280.0040.00418.40
8.0.270.0030.00317.13
8.0.260.0000.00717.07
8.0.250.0030.00317.09
8.0.240.0000.00717.09
8.0.230.0050.00517.09
8.0.220.0000.00716.93
8.0.210.0000.00717.00
8.0.200.0000.00616.98
8.0.190.0000.00717.06
8.0.180.0000.00716.95
8.0.170.0040.00417.06
8.0.160.0040.00416.98
8.0.150.0040.00417.03
8.0.140.0040.00417.00
8.0.130.0030.00313.46
8.0.120.0040.00416.97
8.0.110.0040.00416.89
8.0.100.0000.00717.06
8.0.90.0050.00316.88
8.0.80.0060.01617.00
8.0.70.0040.00417.06
8.0.60.0050.00316.99
8.0.50.0040.00417.07
8.0.30.0030.01717.08
8.0.20.0090.01017.45
8.0.10.0070.00016.95
8.0.00.0100.00716.79
7.4.330.0030.00315.04
7.4.320.0060.00016.82
7.4.300.0000.00716.84
7.4.290.0000.00716.71
7.4.280.0030.00616.61
7.4.270.0000.00816.56
7.4.260.0040.00416.61
7.4.250.0040.00416.81
7.4.240.0020.00516.72
7.4.230.0030.00316.52
7.4.220.0140.00416.81
7.4.210.0110.00716.71
7.4.200.0040.00416.69
7.4.160.0090.00616.53
7.4.150.0050.01317.40
7.4.140.0130.00717.86
7.4.130.0110.00616.73
7.4.120.0090.00816.59
7.4.110.0070.01016.93
7.4.100.0060.01416.80
7.4.90.0160.00516.59
7.4.80.0090.00919.39
7.4.70.0140.00916.60
7.4.60.0070.01016.79
7.4.50.0090.00016.82
7.4.40.0000.01716.89
7.4.30.0110.01416.75
7.4.00.0070.01315.25
7.3.330.0090.00013.46
7.3.320.0090.00413.43
7.3.310.0050.00216.55
7.3.300.0070.00016.56
7.3.290.0100.00816.49
7.3.280.0070.01316.51
7.3.270.0120.00817.40
7.3.260.0070.01016.75
7.3.250.0090.01116.48
7.3.240.0060.01216.56
7.3.230.0090.01216.83
7.3.210.0140.00316.61
7.3.200.0130.00519.39
7.3.190.0090.00616.58
7.3.180.0110.00716.63
7.3.170.0060.01216.76
7.3.160.0000.01816.65
7.3.120.0030.01615.11
7.3.110.0040.01514.66
7.3.100.0040.01114.99
7.3.90.0040.01114.95
7.3.80.0070.01014.94
7.3.70.0060.00314.85
7.3.60.0070.01015.00
7.3.50.0030.00914.75
7.3.40.0000.00915.06
7.3.30.0070.00714.80
7.3.20.0070.00716.73
7.3.10.0070.00716.90
7.3.00.0040.01016.64
7.2.330.0100.00816.55
7.2.320.0070.01516.83
7.2.310.0060.01116.84
7.2.300.0070.01116.81
7.2.290.0120.00916.69
7.2.250.0030.01314.94
7.2.240.0100.01115.17
7.2.230.0080.00815.04
7.2.220.0060.00914.98
7.2.210.0100.01015.09
7.2.200.0030.00614.97
7.2.190.0030.00915.07
7.2.180.0070.00714.94
7.2.170.0120.00015.30
7.2.160.0030.01015.11
7.2.150.0100.00317.24
7.2.140.0060.00916.71
7.2.130.0030.01016.99
7.2.120.0060.01217.24
7.2.110.0090.00616.90
7.2.100.0070.00716.95
7.2.90.0060.00616.96
7.2.80.0070.00416.98
7.2.70.0120.00317.08
7.2.60.0090.00916.83
7.2.50.0090.00916.93
7.2.40.0080.00417.11
7.2.30.0030.00917.18
7.2.20.0100.00317.29
7.2.10.0000.01216.92
7.2.00.0040.00918.44
7.1.330.0000.01415.48
7.1.320.0030.01015.75
7.1.310.0100.00715.78
7.1.300.0130.00015.96
7.1.290.0040.00816.10
7.1.280.0000.01216.05
7.1.270.0090.00315.75
7.1.260.0000.01516.04
7.1.250.0070.00715.97
7.1.200.0030.00916.09
7.1.100.0060.00918.12
7.1.70.0090.00017.54
7.1.60.0180.00719.46
7.1.50.0060.01617.07
7.1.00.0000.08022.37
7.0.200.0450.00314.87
7.0.140.0030.07321.92
7.0.60.0130.06020.00
7.0.50.0100.07717.89
7.0.40.0100.08720.08
7.0.30.0330.06720.12
7.0.20.0370.07720.13
7.0.10.0000.07720.25
7.0.00.0070.05020.31
5.6.280.0070.07021.14
5.6.210.0170.07320.50
5.6.200.0070.08718.22
5.6.190.0000.04720.64
5.6.180.0630.06020.49
5.6.170.0270.08320.55
5.6.160.0070.06020.39
5.6.150.0100.06718.22
5.6.140.0030.04718.16
5.6.130.0030.08018.13
5.6.120.0130.07720.95
5.6.110.0000.04321.03
5.6.100.0070.08020.89
5.6.90.0000.08021.02
5.6.80.0070.07720.29
5.5.350.0230.05720.53
5.5.340.0070.08017.95
5.5.330.0100.05720.32
5.5.320.0270.03720.28
5.5.310.0300.05020.25
5.5.300.0070.07317.95
5.5.290.0200.06317.95
5.5.280.0130.07020.80
5.5.270.0100.06720.83
5.5.260.0100.08320.89
5.5.250.0030.04320.59
5.5.240.0000.04320.35
5.4.450.0430.07319.55
5.4.440.0870.05319.20
5.4.430.0770.05319.70
5.4.420.0370.04319.58
5.4.410.0070.06019.57
5.4.400.0300.04018.85
5.4.390.0130.05718.75
5.4.380.0200.05018.74
5.4.370.0200.05018.68
5.4.360.0170.05318.52
5.4.350.0200.06018.79
5.4.340.0200.05018.70
5.4.320.0170.06318.55
5.4.310.0230.05018.69
5.4.300.0200.05018.56
5.4.290.0200.05318.50
5.4.280.0230.05018.62
5.4.270.0130.05718.82
5.4.260.0270.04318.77
5.4.250.0100.06318.64
5.4.240.0100.06318.51
5.4.230.0100.05318.49
5.4.220.0200.04718.55
5.4.210.0170.05318.59
5.4.200.0300.03716.71
5.4.190.0170.05318.57
5.4.180.0170.06018.61
5.4.170.0170.05718.80
5.4.160.0130.05718.73
5.4.150.0230.04718.43
5.4.140.0200.05016.25
5.4.130.0230.05316.34
5.4.120.0170.05016.36
5.4.110.0170.04716.25
5.4.100.0130.05316.22
5.4.90.0130.05316.45
5.4.80.0200.04316.32
5.4.70.0130.05016.42
5.4.60.0170.04716.15
5.4.50.0130.05316.41
5.4.40.0270.04316.13
5.4.30.0200.04316.39
5.4.20.0230.04716.29
5.4.10.0200.04716.25
5.4.00.0170.06015.70
5.3.290.0100.06314.77
5.3.280.0230.05014.72
5.3.270.0030.06714.80
5.3.260.0300.04314.79
5.3.250.0170.07314.60
5.3.240.0200.05014.65
5.3.230.0170.05014.59
5.3.220.0170.05714.66
5.3.210.0200.05714.58
5.3.200.0270.04314.61
5.3.190.0130.06014.75
5.3.180.0330.03314.75
5.3.170.0100.06014.65
5.3.160.0170.05014.62
5.3.150.0130.06014.66
5.3.140.0200.04714.66
5.3.130.0130.05714.71
5.3.120.0230.05014.74
5.3.110.0130.05714.64
5.3.100.0200.05014.14
5.3.90.0130.05314.00
5.3.80.0170.06714.12
5.3.70.0100.05714.07
5.3.60.0170.05014.05
5.3.50.0130.05314.04
5.3.40.0100.05713.93
5.3.30.0130.05313.93
5.3.20.0100.05713.67
5.3.10.0230.04713.76
5.3.00.0170.05013.69
5.2.170.0170.04011.18
5.2.160.0100.04711.14
5.2.150.0270.04711.43
5.2.140.0100.04311.19
5.2.130.0130.04311.19
5.2.120.0130.04011.23
5.2.110.0200.03311.13
5.2.100.0100.04011.12
5.2.90.0130.04311.16
5.2.80.0130.04011.19
5.2.70.0200.03311.20
5.2.60.0100.04711.10
5.2.50.0100.04711.08
5.2.40.0170.03310.99
5.2.30.0100.04311.03
5.2.20.0170.03311.16
5.2.10.0200.03010.90
5.2.00.0070.04310.85
5.1.60.0030.04010.03
5.1.50.0170.03010.01
5.1.40.0070.03710.02
5.1.30.0100.04010.55
5.1.20.0130.03310.49
5.1.10.0130.03710.07
5.1.00.0230.03710.26
5.0.50.0130.0238.57
5.0.40.0130.0208.54
5.0.30.0070.0438.41
5.0.20.0070.0308.38
5.0.10.0130.0238.20
5.0.00.0070.0408.35
4.4.90.0070.0305.88
4.4.80.0000.0275.86
4.4.70.0070.0275.94
4.4.60.0100.0205.86
4.4.50.0000.0305.94
4.4.40.0070.0375.90
4.4.30.0100.0235.86
4.4.20.0030.0305.91
4.4.10.0100.0235.89
4.4.00.0070.0335.86
4.3.110.0070.0235.77
4.3.100.0070.0235.75
4.3.90.0030.0305.76
4.3.80.0000.0435.78
4.3.70.0070.0305.73
4.3.60.0130.0135.73
4.3.50.0070.0235.72
4.3.40.0070.0405.67
4.3.30.0100.0174.48
4.3.20.0030.0274.46
4.3.10.0030.0234.40
4.3.00.0100.0277.21

preferences:
47.98 ms | 400 KiB | 5 Q