3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mystr_replace($needle,$replace,$haystack){ $args = func_get_args(); $count=null; if(isset($args[3])){ $count &= $args[3]; } var_dump($args); if(is_null($count)) { return str_replace($needle,$replace,$haystack); } else { return str_replace($needle,$replace,$haystack,$count); } } echo mystr_replace("frop","frml","fropfrop")."\n"; echo mystr_replace("frop","frml","fropfrop",1)."\n";

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.00916.75
8.3.50.0100.01021.99
8.3.40.0160.00018.96
8.3.30.0000.01419.18
8.3.20.0040.00420.39
8.3.10.0090.00020.51
8.3.00.0050.00319.38
8.2.180.0120.00316.50
8.2.170.0070.00722.96
8.2.160.0130.01020.50
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0050.00226.16
8.2.120.0000.00821.05
8.2.110.0060.00619.05
8.2.100.0070.00418.16
8.2.90.0080.00419.17
8.2.80.0040.00417.97
8.2.70.0090.00017.63
8.2.60.0060.00617.68
8.2.50.0060.00318.07
8.2.40.0070.00018.18
8.2.30.0040.00419.43
8.2.20.0000.00717.81
8.2.10.0040.00418.08
8.2.00.0000.00717.70
8.1.280.0070.00725.92
8.1.270.0080.00023.97
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0030.00619.28
8.1.230.0070.00418.91
8.1.220.0000.00817.77
8.1.210.0040.00418.77
8.1.200.0030.00617.22
8.1.190.0080.00017.25
8.1.180.0030.00618.10
8.1.170.0030.00618.64
8.1.160.0040.00422.07
8.1.150.0030.00518.97
8.1.140.0000.00717.45
8.1.130.0000.00717.91
8.1.120.0030.00317.46
8.1.110.0040.00417.41
8.1.100.0040.00417.47
8.1.90.0040.00417.37
8.1.80.0040.00417.34
8.1.70.0000.00717.47
8.1.60.0040.00817.61
8.1.50.0030.00517.56
8.1.40.0040.00417.50
8.1.30.0000.00817.56
8.1.20.0080.00017.62
8.1.10.0030.00617.48
8.1.00.0040.00417.41
8.0.300.0050.00318.77
8.0.290.0000.00716.75
8.0.280.0050.00218.46
8.0.270.0050.00317.26
8.0.260.0060.00017.23
8.0.250.0070.00017.03
8.0.240.0000.00716.80
8.0.230.0040.00416.83
8.0.220.0000.00716.91
8.0.210.0000.00716.92
8.0.200.0000.00616.85
8.0.190.0050.00316.95
8.0.180.0040.00416.91
8.0.170.0090.00016.97
8.0.160.0070.00016.89
8.0.150.0000.00816.77
8.0.140.0020.00816.73
8.0.130.0030.00313.39
8.0.120.0000.00816.88
8.0.110.0070.00016.96
8.0.100.0040.00416.93
8.0.90.0040.00416.87
8.0.80.0030.01716.93
8.0.70.0050.00316.89
8.0.60.0080.00016.84
8.0.50.0000.00716.89
8.0.30.0090.00917.09
8.0.20.0110.01017.40
8.0.10.0000.00717.04
8.0.00.0070.01016.68
7.4.330.0060.00015.09
7.4.320.0030.00316.55
7.4.300.0000.00616.63
7.4.290.0000.00716.50
7.4.280.0080.00316.43
7.4.270.0030.00316.52
7.4.260.0000.00716.54
7.4.250.0040.00416.33
7.4.240.0030.00316.49
7.4.230.0070.00016.69
7.4.220.0140.00516.68
7.4.210.0060.00916.45
7.4.200.0000.00716.48
7.4.160.0140.00316.45
7.4.150.0090.01017.40
7.4.140.0100.01217.86
7.4.130.0040.01316.64
7.4.120.0080.00916.53
7.4.110.0100.00616.41
7.4.100.0180.00016.63
7.4.90.0120.00416.57
7.4.80.0080.01219.39
7.4.70.0050.01016.61
7.4.60.0130.00716.38
7.4.50.0040.00416.32
7.4.40.0060.01116.77
7.4.30.0130.00316.52
7.4.00.0040.01114.64
7.3.330.0050.00013.18
7.3.320.0000.00613.18
7.3.310.0070.00016.38
7.3.300.0030.00316.30
7.3.290.0060.01216.33
7.3.280.0050.01016.25
7.3.270.0080.00817.40
7.3.260.0120.00616.46
7.3.250.0080.01016.42
7.3.240.0090.00616.30
7.3.230.0130.00316.39
7.3.210.0070.01116.41
7.3.200.0100.01019.39
7.3.190.0040.01416.63
7.3.180.0100.00716.30
7.3.170.0100.00616.34
7.3.160.0090.01416.34
7.3.10.0040.00716.31
7.3.00.0070.00716.79
7.2.330.0140.00316.35
7.2.320.0100.00716.60
7.2.310.0070.01016.58
7.2.300.0030.01416.74
7.2.290.0060.01216.85
7.2.130.0060.00916.83
7.2.120.0000.01516.96
7.2.110.0130.00316.87
7.2.100.0080.00416.88
7.2.90.0070.00716.77
7.2.80.0060.00616.91
7.2.70.0090.00317.03
7.2.60.0060.00617.05
7.2.50.0070.01017.09
7.2.40.0040.00816.99
7.2.30.0090.00316.83
7.2.20.0060.00916.78
7.2.10.0090.00616.61
7.2.00.0030.00618.05
7.1.250.0090.00015.86
7.1.100.0070.01017.91
7.1.70.0090.00917.16
7.1.60.0140.01119.61
7.1.50.0030.01316.75
7.1.00.0000.08022.32
7.0.200.0000.01016.61
7.0.140.0100.06722.21
7.0.60.0300.05720.02
7.0.50.0170.03717.89
7.0.40.0170.08320.04
7.0.30.0530.05720.24
7.0.20.0170.04720.22
7.0.10.0070.08320.22
7.0.00.0070.05720.06
5.6.280.0030.06321.10
5.6.210.0100.08320.44
5.6.200.0100.05018.12
5.6.190.0030.04320.55
5.6.180.0300.07020.43
5.6.170.0330.08320.55
5.6.160.0130.06720.44
5.6.150.0130.07018.23
5.6.140.0100.04018.18
5.6.130.0000.07318.18
5.6.120.0030.08721.09
5.6.110.0070.08721.01
5.6.100.0030.07021.01
5.6.90.0030.04320.98
5.6.80.0100.06020.31
5.5.350.0130.04020.46
5.5.340.0030.08318.04
5.5.330.0100.04020.42
5.5.320.0030.06320.19
5.5.310.0300.07320.38
5.5.300.0030.04017.95
5.5.290.0000.07718.06
5.5.280.0030.06320.69
5.5.270.0030.04020.64
5.5.260.0030.06720.80
5.5.250.0030.04020.77
5.5.240.0130.03720.29
5.4.450.0330.03719.46
5.4.440.0400.05019.47
5.4.430.0300.04319.23
5.4.420.0270.05319.63
5.4.410.0070.06019.54
5.4.400.0130.05719.35
5.4.390.0100.06019.34
5.4.380.0430.06718.52
5.4.370.0370.04718.73
5.4.360.0400.05018.56
5.4.350.0230.05318.78
5.4.340.0400.06718.83
5.4.320.0100.03512.50
5.4.310.0060.03812.50
5.4.300.0090.04912.50
5.4.290.0070.04612.50
5.4.280.0070.04512.40
5.4.270.0080.04212.39
5.4.260.0060.03812.40
5.4.250.0090.03712.40
5.4.240.0120.03912.40
5.4.230.0080.05212.39
5.4.220.0090.04112.39
5.4.210.0040.03712.39
5.4.200.0070.04112.39
5.4.190.0050.03712.39
5.4.180.0080.03412.38
5.4.170.0020.04012.39
5.4.160.0060.04112.39
5.4.150.0090.04712.39
5.4.140.0090.05012.07
5.4.130.0100.03912.06
5.4.120.0060.03512.02
5.4.110.0090.03312.01
5.4.100.0070.03412.02
5.4.90.0060.03912.01
5.4.80.0090.03512.01
5.4.70.0060.03512.01
5.4.60.0110.03112.01
5.4.50.0050.03712.01
5.4.40.0060.03812.00
5.4.30.0080.04111.99
5.4.20.0080.03811.99
5.4.10.0050.03711.99
5.4.00.0060.04311.48
5.3.290.0050.04212.80
5.3.280.0080.03912.71
5.3.270.0070.04312.72
5.3.260.0090.05012.72
5.3.250.0110.04012.72
5.3.240.0060.04012.72
5.3.230.0070.04712.71
5.3.220.0090.03912.68
5.3.210.0060.04012.68
5.3.200.0060.04512.68
5.3.190.0070.03712.68
5.3.180.0080.03512.67
5.3.170.0090.03812.67
5.3.160.0090.04312.68
5.3.150.0020.04012.68
5.3.140.0130.04312.66
5.3.130.0080.04412.66
5.3.120.0070.04712.66
5.3.110.0090.03712.66
5.3.100.0110.04012.12
5.3.90.0050.03912.10
5.3.80.0050.03812.09
5.3.70.0090.04112.09
5.3.60.0090.05212.08
5.3.50.0090.04212.02
5.3.40.0050.03912.02
5.3.30.0100.03111.98
5.3.20.0080.03711.76
5.3.10.0040.03711.73
5.3.00.0050.03811.72
5.2.170.0030.0329.21
5.2.160.0070.0369.22
5.2.150.0070.0299.22
5.2.140.0060.0349.21
5.2.130.0070.0399.18
5.2.120.0060.0359.17
5.2.110.0050.0299.18
5.2.100.0030.0309.17
5.2.90.0040.0299.17
5.2.80.0060.0289.17
5.2.70.0040.0309.17
5.2.60.0080.0279.13
5.2.50.0060.0299.09
5.2.40.0050.0289.07
5.2.30.0070.0359.04
5.2.20.0060.0499.04
5.2.10.0060.0388.94
5.2.00.0030.0308.80
5.1.60.0030.0248.09
5.1.50.0060.0228.08
5.1.40.0030.0258.07
5.1.30.0050.0258.41
5.1.20.0020.0278.44
5.1.10.0040.0258.16
5.1.00.0080.0218.16
5.0.50.0030.0206.64
5.0.40.0040.0186.50
5.0.30.0030.0316.31
5.0.20.0050.0176.27
5.0.10.0050.0176.25
5.0.00.0030.0306.25
4.4.90.0010.0184.78
4.4.80.0020.0154.75
4.4.70.0030.0154.76
4.4.60.0040.0144.76
4.4.50.0030.0154.77
4.4.40.0020.0284.71
4.4.30.0020.0164.76
4.4.20.0010.0174.84
4.4.10.0030.0154.85
4.4.00.0020.0254.76
4.3.110.0030.0154.66
4.3.100.0030.0154.66
4.3.90.0040.0134.63
4.3.80.0040.0224.58
4.3.70.0020.0154.63
4.3.60.0030.0144.62
4.3.50.0020.0164.63
4.3.40.0040.0224.54
4.3.30.0050.0133.30
4.3.20.0010.0173.28
4.3.10.0020.0163.24
4.3.00.0100.03313.57

preferences:
58.8 ms | 400 KiB | 5 Q