3v4l.org

run code in 300+ PHP versions simultaneously
<?php class stringable { function __toString() { return "abc"; } } $s = new stringable(); // AS EXPECTED: converts the object into a string executes the replace in the same fashion with a plain php string var_dump(str_replace('a', 'x', $s)); var_dump(strpos('abcd', $s)); var_dump(stripos('abcd', $s));

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.0110.00718.45
8.3.30.0000.01418.72
8.3.20.0080.00020.16
8.3.10.0030.00521.92
8.3.00.0040.00420.96
8.2.170.0110.00718.78
8.2.160.0100.00722.96
8.2.150.0070.00725.66
8.2.140.0050.00224.66
8.2.130.0040.00421.02
8.2.120.0040.00426.16
8.2.110.0130.00719.45
8.2.100.0070.00317.84
8.2.90.0040.00419.34
8.2.80.0000.00817.97
8.2.70.0050.00317.80
8.2.60.0040.00418.09
8.2.50.0040.00418.10
8.2.40.0040.00420.49
8.2.30.0000.00719.12
8.2.20.0000.00717.98
8.2.10.0050.00318.00
8.2.00.0000.00917.97
8.1.270.0040.00424.66
8.1.260.0000.00826.35
8.1.250.0030.00628.09
8.1.240.0100.00022.47
8.1.230.0070.00420.91
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0070.00317.23
8.1.190.0050.00317.10
8.1.180.0000.00818.10
8.1.170.0050.00318.65
8.1.160.0050.00218.83
8.1.150.0000.00820.59
8.1.140.0080.00019.50
8.1.130.0000.00718.75
8.1.120.0030.00317.42
8.1.110.0030.00617.45
8.1.100.0050.00217.45
8.1.90.0040.00417.36
8.1.80.0070.00017.43
8.1.70.0080.00017.29
8.1.60.0060.00317.38
8.1.50.0040.00417.35
8.1.40.0040.00417.45
8.1.30.0060.00317.48
8.1.20.0000.00817.48
8.1.10.0080.00017.38
8.1.00.0040.00417.33
8.0.300.0040.00419.85
8.0.290.0050.00216.63
8.0.280.0000.00718.32
8.0.270.0000.00717.10
8.0.260.0030.00318.81
8.0.250.0000.00816.99
8.0.240.0040.00416.96
8.0.230.0030.00316.93
8.0.220.0030.00316.89
8.0.210.0000.00716.89
8.0.200.0000.00716.97
8.0.190.0000.00816.96
8.0.180.0070.00316.94
8.0.170.0000.00916.84
8.0.160.0030.00316.82
8.0.150.0070.00016.79
8.0.140.0030.00616.68
8.0.130.0060.00013.31
8.0.120.0000.00716.93
8.0.110.0070.00016.87
8.0.100.0000.00816.93
8.0.90.0020.00516.70
8.0.80.0060.01016.88
8.0.70.0000.00716.75
8.0.60.0070.00016.99
8.0.50.0040.00416.88
8.0.30.0140.00517.05
8.0.20.0120.00917.40
8.0.10.0070.00017.05
8.0.00.0100.00716.70
7.4.330.0050.00015.55
7.4.320.0070.00016.35
7.4.300.0030.00316.45
7.4.290.0030.00316.59
7.4.280.0050.00316.48
7.4.270.0030.00316.46
7.4.260.0000.00716.50
7.4.250.0000.00816.57
7.4.240.0000.00716.60
7.4.230.0000.00716.27
7.4.220.0130.00616.43
7.4.210.0030.01116.61
7.4.200.0030.00316.69
7.4.160.0080.00816.38
7.4.150.0150.00417.40
7.4.140.0110.00917.86
7.4.130.0120.00616.43
7.4.120.0150.00816.43
7.4.110.0150.00316.48
7.4.100.0100.00716.40
7.4.90.0140.00416.43
7.4.80.0080.01219.39
7.4.70.0110.01116.47
7.4.60.0000.01616.60
7.4.50.0060.00916.47
7.4.40.0060.01016.61
7.4.30.0190.00316.58
7.4.00.0120.00614.59
7.3.330.0000.00513.37
7.3.320.0000.00513.23
7.3.310.0000.00816.32
7.3.300.0070.00016.30
7.3.290.0030.01216.28
7.3.280.0080.00816.29
7.3.270.0110.00717.40
7.3.260.0100.01216.43
7.3.250.0120.00716.26
7.3.240.0070.01216.29
7.3.230.0060.01016.29
7.3.210.0070.01016.30
7.3.200.0130.00616.22
7.3.190.0120.00416.16
7.3.180.0130.00616.38
7.3.170.0120.00416.20
7.3.160.0100.00616.38
7.3.10.0090.00716.14
7.3.00.0060.00716.23
7.2.330.0070.01016.37
7.2.320.0130.00316.48
7.2.310.0130.00316.49
7.2.300.0030.01516.32
7.2.290.0080.00816.49
7.2.130.0050.00916.62
7.2.120.0070.00816.55
7.2.110.0050.00916.32
7.2.100.0070.00916.60
7.2.90.0080.00416.49
7.2.80.0070.00916.52
7.2.70.0060.00816.52
7.2.60.0070.00616.44
7.2.50.0090.00316.41
7.2.40.0080.00616.36
7.2.30.0060.00916.54
7.2.20.0080.00616.70
7.2.10.0080.00816.54
7.2.00.0090.00716.64
7.1.250.0100.00515.20
7.1.240.0100.01015.10
7.1.230.0030.01015.51
7.1.220.0100.00715.27
7.1.210.0070.00715.61
7.1.200.0040.00915.38
7.1.190.0100.00615.27
7.1.180.0030.01015.51
7.1.170.0070.00415.58
7.1.160.0100.00715.41
7.1.150.0100.00315.82
7.1.140.0100.00315.66
7.1.130.0030.01015.66
7.1.120.0110.00415.48
7.1.110.0060.00915.09
7.1.100.0100.00315.61
7.1.90.0030.01015.55
7.1.80.0070.00616.66
7.1.70.0010.01316.33
7.1.60.0130.00625.31
7.1.50.0090.01525.17
7.1.40.0140.00925.02
7.1.30.0100.00924.80
7.1.20.0140.00925.20
7.1.10.0070.00816.11
7.1.00.0060.00916.03
7.0.330.0030.00915.13
7.0.320.0070.00414.79
7.0.310.0000.01415.14
7.0.300.0100.00615.32
7.0.290.0100.00615.20
7.0.280.0070.00715.04
7.0.270.0060.01015.15
7.0.260.0100.00314.82
7.0.250.0090.00914.91
7.0.240.0090.00615.01
7.0.230.0030.00914.59
7.0.220.0090.00614.94
7.0.210.0070.00715.12
7.0.200.0050.01115.76
7.0.190.0080.00715.70
7.0.180.0050.00915.49
7.0.170.0080.00415.67
7.0.160.0050.00815.63
7.0.150.0030.01215.55
7.0.140.0080.00315.71
7.0.130.0060.00915.82
7.0.120.0030.01415.70
7.0.110.0060.01015.43
7.0.100.0080.00815.45
7.0.90.0110.00515.51
7.0.80.0080.00715.71
7.0.70.0090.00715.75
7.0.60.0060.01015.52
7.0.50.0060.01015.72
7.0.40.0050.01114.91
7.0.30.0110.00514.83
7.0.20.0050.00814.81
7.0.10.0070.00614.73
7.0.00.0060.00614.69
5.6.380.0070.01113.76

preferences:
53.6 ms | 400 KiB | 5 Q