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.40.0140.00719.18
8.3.30.0060.00919.09
8.3.20.0080.00020.20
8.3.10.0000.00721.90
8.3.00.0060.00319.50
8.2.170.0140.00422.96
8.2.160.0100.00320.35
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0080.00019.66
8.2.110.0070.00321.06
8.2.100.0060.00617.75
8.2.90.0040.00419.07
8.2.80.0040.00417.97
8.2.70.0040.00417.75
8.2.60.0000.00817.91
8.2.50.0060.00318.07
8.2.40.0040.00419.95
8.2.30.0040.00417.89
8.2.20.0000.00817.82
8.2.10.0030.00518.05
8.2.00.0040.00417.76
8.1.270.0060.00320.52
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0060.00323.83
8.1.230.0080.00318.90
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0000.01017.35
8.1.190.0040.00417.36
8.1.180.0000.00818.10
8.1.170.0030.00620.50
8.1.160.0080.00022.02
8.1.150.0040.00418.83
8.1.140.0000.00717.53
8.1.130.0000.00817.89
8.1.120.0070.00017.44
8.1.110.0040.00417.54
8.1.100.0040.00417.54
8.1.90.0030.00517.55
8.1.80.0000.00817.38
8.1.70.0000.00717.58
8.1.60.0000.00817.63
8.1.50.0030.00617.54
8.1.40.0000.00917.56
8.1.30.0080.00017.71
8.1.20.0050.00217.83
8.1.10.0040.00417.66
8.1.00.0040.00417.62
8.0.300.0000.00718.77
8.0.290.0040.00416.88
8.0.280.0040.00418.45
8.0.270.0000.00717.17
8.0.260.0030.00317.20
8.0.250.0000.00717.14
8.0.240.0030.00317.07
8.0.230.0000.00816.98
8.0.220.0030.00316.93
8.0.210.0040.00417.04
8.0.200.0020.00517.08
8.0.190.0040.00417.09
8.0.180.0070.00017.09
8.0.170.0040.00417.00
8.0.160.0000.00717.03
8.0.150.0030.00517.00
8.0.140.0000.00717.03
8.0.130.0060.00013.46
8.0.120.0090.00016.99
8.0.110.0040.00417.06
8.0.100.0000.00816.93
8.0.90.0000.00817.01
8.0.80.0220.00016.91
8.0.70.0050.00316.92
8.0.60.0040.00416.91
8.0.50.0000.00716.94
8.0.30.0120.00517.23
8.0.20.0110.01117.46
8.0.10.0000.00717.09
8.0.00.0070.01116.77
7.4.330.0060.00015.03
7.4.320.0030.00316.61
7.4.300.0030.00316.78
7.4.290.0070.00016.70
7.4.280.0070.00016.71
7.4.270.0040.00416.75
7.4.260.0000.00816.82
7.4.250.0090.00016.76
7.4.240.0030.00316.70
7.4.230.0030.00316.60
7.4.220.0160.00616.71
7.4.210.0030.01016.71
7.4.200.0000.00716.52
7.4.160.0070.01016.61
7.4.150.0100.00717.40
7.4.140.0120.00717.86
7.4.130.0080.01116.72
7.4.120.0070.01016.68
7.4.110.0150.00416.84
7.4.100.0120.00616.65
7.4.90.0150.00416.71
7.4.80.0030.02019.39
7.4.70.0060.01216.57
7.4.60.0000.02216.47
7.4.50.0060.00316.64
7.4.40.0160.00616.81
7.4.30.0090.01716.91
7.4.00.0100.00714.78
7.3.330.0060.00313.48
7.3.320.0090.00413.46
7.3.310.0050.00316.54
7.3.300.0070.00016.37
7.3.290.0080.00816.47
7.3.280.0100.00916.52
7.3.270.0130.00417.40
7.3.260.0110.00716.51
7.3.250.0110.00816.55
7.3.240.0070.01716.81
7.3.230.0100.00716.46
7.3.210.0120.00316.59
7.3.200.0100.00719.39
7.3.190.0060.00916.71
7.3.180.0030.01316.72
7.3.170.0040.01416.51
7.3.160.0090.00916.64
7.3.00.0170.00316.73
7.2.330.0030.01516.63
7.2.320.0110.01616.82
7.2.310.0070.01616.93
7.2.300.0120.00616.75
7.2.290.0140.00416.53
7.2.130.0110.01116.88
7.2.120.0070.01116.75
7.2.110.0100.00517.09
7.2.100.0230.00616.46
7.2.90.0130.01116.67
7.2.80.0160.01216.95
7.2.70.0170.01016.84
7.2.60.0110.01117.02
7.2.50.0170.00817.02
7.2.40.0220.00317.05
7.2.30.0110.00416.57
7.2.20.0100.01016.70
7.2.10.0100.01016.62
7.2.00.0120.00618.09
7.1.250.0110.01115.95
7.1.240.0110.00815.99
7.1.230.0190.00315.64
7.1.220.0100.01015.83
7.1.210.0160.00815.94
7.1.200.0070.01515.68
7.1.190.0170.00715.70
7.1.180.0160.00815.96
7.1.170.0160.01015.91
7.1.160.0110.01415.69
7.1.150.0170.00415.97
7.1.140.0120.00615.91
7.1.130.0080.01715.83
7.1.120.0160.00815.98
7.1.110.0070.01415.85
7.1.100.0120.00616.97
7.1.90.0210.00516.01
7.1.80.0140.01015.72
7.1.70.0110.00816.57
7.1.60.0080.00916.70
7.1.50.0110.01216.47
7.1.40.0070.01715.55
7.1.30.0050.00915.96
7.1.20.0170.01015.72
7.1.10.0120.01215.93
7.1.00.0060.04119.08
7.0.330.0160.00415.26
7.0.320.0120.01215.42
7.0.310.0160.00415.26
7.0.300.0140.00315.43
7.0.290.0150.00815.40
7.0.280.0120.00415.54
7.0.270.0090.01215.55
7.0.260.0120.01215.36
7.0.250.0100.01415.54
7.0.240.0120.01215.56
7.0.230.0170.01015.37
7.0.220.0250.00315.18
7.0.210.0300.00315.41
7.0.200.0100.01216.21
7.0.190.0160.01215.50
7.0.180.0150.00715.54
7.0.170.0110.00815.45
7.0.160.0230.00415.64
7.0.150.0080.01215.60
7.0.140.0090.03818.74
7.0.130.0100.00815.25
7.0.120.0190.00315.71
7.0.110.0130.01015.45
7.0.100.0180.00615.38
7.0.90.0060.01115.63
7.0.80.0120.01215.25
7.0.70.0060.01415.36
7.0.60.0080.03717.64
7.0.50.0130.04116.64
7.0.40.0020.03316.93
7.0.30.0190.03816.76
7.0.20.0210.04616.80
7.0.10.0330.03216.67
7.0.00.0080.02517.02
5.6.380.0110.00714.16
5.6.370.0090.01014.29
5.6.360.0170.00014.10
5.6.350.0100.00714.38
5.6.340.0060.01214.35
5.6.330.0060.00914.46
5.6.320.0080.00814.24
5.6.310.0110.00613.89
5.6.300.0110.00314.27
5.6.290.0000.01614.29
5.6.280.0070.04117.71
5.6.270.0040.01814.29
5.6.260.0050.01914.38
5.6.250.0140.01014.30
5.6.240.0110.01114.22
5.6.230.0070.01314.10
5.6.220.0070.01014.44
5.6.210.0030.04717.47
5.6.200.0050.03116.39
5.6.190.0150.03617.22
5.6.180.0130.02317.38
5.6.170.0220.04617.46
5.6.160.0050.03217.40
5.6.150.0020.03916.37
5.6.140.0070.03516.24
5.6.130.0050.04616.15
5.6.120.0060.04417.56
5.6.110.0030.04817.57
5.6.100.0080.04017.48
5.6.90.0130.03417.63
5.6.80.0130.03217.25
5.6.70.0150.03317.32
5.6.60.0070.00714.24
5.6.50.0040.01214.39
5.6.40.0030.00913.98
5.6.30.0080.00414.31
5.6.20.0030.00914.23
5.6.10.0040.00814.51
5.6.00.0100.00314.20
5.5.380.0100.00311.18
5.5.370.0030.00711.18
5.5.360.0060.00611.18
5.5.350.0080.03815.78
5.5.340.0100.03514.58
5.5.330.0050.04615.87
5.5.320.0040.02915.79
5.5.310.0130.03015.85
5.5.300.0090.03514.64
5.5.290.0070.04414.61
5.5.280.0070.03415.92
5.5.270.0050.04615.91
5.5.260.0080.04215.97
5.5.250.0080.04615.98
5.5.240.0040.04215.67
5.5.230.0090.00411.18
5.5.220.0040.00711.18
5.5.210.0030.00311.18
5.5.200.0060.00611.18
5.5.190.0000.00911.18
5.5.180.0030.00611.18
5.5.170.0000.01011.18
5.5.160.0030.00611.20
5.5.150.0000.01111.32
5.5.140.0090.00311.18
5.5.130.0040.00411.18
5.5.120.0000.01011.18
5.5.110.0040.00711.18
5.5.100.0030.00711.18
5.5.90.0070.00411.18
5.5.80.0060.00611.34
5.5.70.0030.00711.31
5.5.60.0070.00311.18
5.5.50.0000.01111.18
5.5.40.0040.00711.20
5.5.30.0070.00011.18
5.5.20.0040.00711.27
5.5.10.0100.00311.18
5.5.00.0050.00611.18
5.4.450.0100.03515.39
5.4.440.0360.03215.32
5.4.430.0440.02515.39
5.4.420.0120.02715.40
5.4.410.0460.02215.26
5.4.400.0160.03315.01
5.4.390.0070.03414.87
5.4.380.0120.03214.98
5.4.370.0100.03114.96
5.4.360.0050.03214.96
5.4.350.0120.03014.82
5.4.340.0100.02714.96
5.4.330.0060.00311.18
5.4.320.0150.02714.97
5.4.310.0070.03214.85
5.4.300.0100.02914.98
5.4.290.0120.02614.89
5.4.280.0110.02814.90
5.4.270.0120.02714.84
5.4.260.0100.02914.81
5.4.250.0130.03314.85
5.4.240.0070.03414.88
5.4.230.0140.02615.00
5.4.220.0100.03014.88
5.4.210.0120.03814.97
5.4.200.0100.03113.95
5.4.190.0130.02814.94
5.4.180.0130.02714.93
5.4.170.0150.02414.87
5.4.160.0120.02714.91
5.4.150.0140.02615.00
5.4.140.0160.03013.71
5.4.130.0130.02613.82
5.4.120.0030.04413.92
5.4.110.0080.02813.72
5.4.100.0180.02613.69
5.4.90.0100.03213.70
5.4.80.0070.03113.69
5.4.70.0140.03113.68
5.4.60.0080.02913.74
5.4.50.0070.03013.70
5.4.40.0120.02713.71
5.4.30.0090.02913.73
5.4.20.0150.02513.78
5.4.10.0110.02613.66
5.4.00.0130.02613.43
5.3.290.0120.02812.95
5.3.280.0120.02712.99
5.3.270.0100.03212.99
5.3.260.0030.03512.99
5.3.250.0080.03012.98
5.3.240.0130.02512.91
5.3.230.0110.02512.94
5.3.220.0070.03413.01
5.3.210.0130.02812.86
5.3.200.0120.02712.92
5.3.190.0070.03213.01
5.3.180.0100.02812.88
5.3.170.0120.02612.93
5.3.160.0120.02712.89
5.3.150.0100.02913.02
5.3.140.0110.02712.95
5.3.130.0120.02712.96
5.3.120.0100.02812.89
5.3.110.0080.02912.91
5.3.100.0080.03012.60
5.3.90.0100.03712.74
5.3.80.0070.03412.68
5.3.70.0060.02812.65
5.3.60.0050.03012.64
5.3.50.0080.03312.63
5.3.40.0120.02312.67
5.3.30.0130.02312.68
5.3.20.0070.03212.50
5.3.10.0030.03312.44
5.3.00.0100.03012.40
5.2.170.0120.02211.19
5.2.160.0060.02311.15
5.2.150.0070.02411.15
5.2.140.0050.02711.22
5.2.130.0100.02011.20
5.2.120.0070.02511.16
5.2.110.0090.02011.28
5.2.100.0070.02311.28
5.2.90.0070.02311.19
5.2.80.0110.02111.13
5.2.70.0070.02511.24
5.2.60.0070.02511.16
5.2.50.0090.02311.15
5.2.40.0090.02011.08
5.2.30.0020.03011.10
5.2.20.0060.02311.09
5.2.10.0090.02111.07
5.2.00.0030.02811.05
5.1.60.0090.01610.60
5.1.50.0100.01610.64
5.1.40.0120.01710.57
5.1.30.0060.02110.75
5.1.20.0050.02310.87
5.1.10.0070.01910.64
5.1.00.0090.01710.63
5.0.50.0030.0189.87
5.0.40.0020.0189.84
5.0.30.0050.0239.74
5.0.20.0050.0179.73
5.0.10.0060.0139.74
5.0.00.0050.0249.73
4.4.90.0070.0158.52
4.4.80.0080.0128.51
4.4.70.0050.0158.47
4.4.60.0090.0118.50
4.4.50.0090.0138.51
4.4.40.0050.0198.49
4.4.30.0020.0178.49
4.4.20.0050.0138.57
4.4.10.0080.0138.55
4.4.00.0020.0278.55
4.3.110.0050.0158.52
4.3.100.0070.0138.51
4.3.90.0050.0168.50
4.3.80.0000.0248.45
4.3.70.0040.0138.45
4.3.60.0090.0098.47
4.3.50.0070.0158.47
4.3.40.0050.0218.45
4.3.30.0020.0157.83
4.3.20.0050.0147.83
4.3.10.0020.0127.83
4.3.00.0030.0119.06

preferences:
47.53 ms | 400 KiB | 5 Q