3v4l.org

run code in 300+ PHP versions simultaneously
<?php class stringable1 { function __toString() { return "abc"; } } $s = new stringable1(); // 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.4.120.0130.00724.02
8.4.110.0100.00822.63
8.4.100.0130.00817.76
8.4.90.0090.01317.50
8.4.80.0050.00317.96
8.4.70.0120.00317.77
8.4.60.0130.00718.63
8.4.50.0110.00717.71
8.4.40.0160.00317.63
8.4.30.0130.00620.38
8.4.20.0100.01017.62
8.4.10.0080.00020.47
8.3.250.0110.00718.84
8.3.240.0100.00917.07
8.3.230.0030.00616.54
8.3.220.0120.00516.96
8.3.210.0030.00516.64
8.3.200.0040.00516.72
8.3.190.0070.00217.11
8.3.180.0120.00717.27
8.3.170.0070.00716.60
8.3.160.0070.01116.61
8.3.150.0030.00617.27
8.3.140.0110.00718.84
8.3.130.0070.00718.34
8.3.120.0090.00020.79
8.3.110.0050.00520.94
8.3.100.0030.00724.06
8.3.90.0040.00426.77
8.3.80.0060.00316.38
8.3.70.0150.00016.63
8.3.60.0210.00016.63
8.3.50.0120.00523.55
8.3.40.0120.00321.78
8.3.30.0090.00618.59
8.3.20.0080.00024.18
8.3.10.0080.00024.66
8.3.00.0060.00326.16
8.2.290.0090.00920.28
8.2.280.0090.00818.23
8.2.270.0110.00717.26
8.2.260.0030.01318.98
8.2.250.0060.00916.62
8.2.240.0120.00617.19
8.2.230.0160.00322.58
8.2.220.0060.00337.54
8.2.210.0090.00626.77
8.2.200.0040.00416.75
8.2.190.0040.01116.58
8.2.180.0130.00725.92
8.2.170.0120.00418.89
8.2.160.0070.00722.96
8.2.150.0000.00725.66
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0040.00426.35
8.2.110.0100.00022.08
8.2.100.0110.00419.18
8.2.90.0060.00317.75
8.2.80.0060.00318.66
8.2.70.0080.00017.34
8.2.60.0000.00817.93
8.2.50.0060.00318.07
8.2.40.0000.00918.16
8.2.30.0040.00417.98
8.2.20.0000.00818.12
8.2.10.0040.00419.15
8.2.00.0000.00719.11
8.1.330.0100.00818.29
8.1.320.0080.01115.97
8.1.310.0080.00316.58
8.1.300.0100.00717.85
8.1.290.0060.00318.88
8.1.280.0110.00425.92
8.1.270.0000.00823.99
8.1.260.0000.00728.09
8.1.250.0070.00028.09
8.1.240.0140.00723.88
8.1.230.0080.00419.15
8.1.220.0030.00618.60
8.1.210.0040.00418.77
8.1.200.0040.00417.35
8.1.190.0040.00417.23
8.1.180.0030.00518.10
8.1.170.0040.00418.61
8.1.160.0000.00718.89
8.1.150.0050.00218.89
8.1.140.0070.00018.83
8.1.130.0040.00417.39
8.1.120.0070.00017.43
8.1.110.0030.00517.34
8.1.100.0000.00717.48
8.1.90.0000.00817.38
8.1.80.0060.00617.47
8.1.70.0030.00317.42
8.1.60.0050.00317.59
8.1.50.0000.00817.52
8.1.40.0060.00317.50
8.1.30.0000.00817.54
8.1.20.0000.00717.66
8.1.10.0050.00217.43
8.1.00.0040.00417.43
8.0.300.0090.00018.77
8.0.290.0060.00316.63
8.0.280.0040.00418.36
8.0.270.0030.00318.00
8.0.260.0000.00716.78
8.0.250.0030.00616.93
8.0.240.0000.00716.87
8.0.230.0000.00716.97
8.0.220.0050.00316.77
8.0.210.0070.00016.80
8.0.200.0040.00416.88
8.0.190.0000.00716.84
8.0.180.0000.00716.81
8.0.170.0000.00916.80
8.0.160.0000.00716.79
8.0.150.0030.00516.91
8.0.140.0000.00716.79
8.0.130.0000.00513.36
8.0.120.0040.00416.86
8.0.110.0050.00316.83
8.0.100.0040.00416.89
8.0.90.0000.00716.92
8.0.80.0080.01116.85
8.0.70.0070.00016.83
8.0.60.0080.00016.71
8.0.50.0040.00416.82
8.0.30.0140.01017.14
8.0.20.0180.00517.01
8.0.10.0000.00716.80
8.0.00.0120.00816.74
7.4.330.0000.00415.55
7.4.320.0030.00316.39
7.4.300.0060.00316.52
7.4.290.0070.00016.45
7.4.280.0050.00316.51
7.4.270.0040.00416.61
7.4.260.0030.00313.29
7.4.250.0040.00416.48
7.4.240.0000.00716.51
7.4.230.0030.00316.35
7.4.220.0070.00016.42
7.4.210.0090.00516.56
7.4.200.0070.00016.50
7.4.130.0090.01016.51
7.4.120.0080.01616.53
7.4.110.0100.00716.51
7.4.100.0060.01216.40
7.4.90.0190.00516.29
7.4.80.0030.01516.51
7.4.70.0070.01016.19
7.4.60.0140.00416.43
7.4.50.0070.01016.27
7.4.40.0040.01616.48
7.4.30.0160.00016.66
7.4.20.0110.00816.38
7.4.10.0080.00816.27
7.4.00.0180.00016.46
7.3.330.0030.00516.33
7.3.320.0060.00013.10
7.3.310.0030.00316.29
7.3.300.0030.00316.19
7.3.290.0110.00416.25
7.3.260.0140.00316.62
7.3.230.0110.00716.34
7.3.220.0100.00716.26
7.3.210.0120.00416.28
7.3.200.0050.01116.45
7.3.190.0070.00916.50
7.3.180.0060.01116.37
7.3.170.0050.01116.22
7.3.160.0000.01616.24
7.3.150.0150.00216.20
7.3.140.0130.00316.44
7.3.130.0100.01016.46
7.3.120.0160.00616.20
7.3.110.0110.01116.15
7.3.100.0170.00816.34
7.3.90.0150.00216.39
7.3.80.0120.00616.30
7.3.70.0060.01116.29
7.3.60.0120.00416.27
7.3.50.0120.00616.21
7.3.40.0030.01416.15
7.3.30.0080.00916.33
7.3.20.0170.00516.31
7.3.10.0060.01216.23
7.3.00.0120.01016.36
7.2.340.0050.01416.46
7.2.330.0100.00616.57
7.2.320.0080.01116.21
7.2.310.0120.00616.48
7.2.300.0060.01116.27
7.2.290.0090.00916.20
7.2.280.0030.01516.50
7.2.270.0120.00616.57
7.2.260.0100.00716.49
7.2.250.0150.00316.66
7.2.240.0060.01116.31
7.2.230.0050.01216.53
7.2.220.0110.00816.18
7.2.210.0120.00816.38
7.2.200.0090.00916.28
7.2.190.0060.01216.43
7.2.180.0110.00516.43
7.2.170.0100.01016.35
7.2.160.0100.00716.55
7.2.150.0170.00016.39
7.2.140.0080.01216.40
7.2.130.0180.00016.51
7.2.120.0150.00516.30
7.2.110.0070.01616.36
7.2.100.0190.00016.51
7.2.90.0090.00916.43
7.2.80.0110.00716.42
7.2.70.0200.00616.29
7.2.60.0130.01016.33
7.2.50.0160.00616.37
7.2.40.0120.00816.30
7.2.30.0140.00616.48
7.2.20.0130.01016.41
7.2.10.0080.01316.25
7.2.00.0130.00616.71

preferences:
30.84 ms | 403 KiB | 5 Q