3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo substr_replace('stack', 'i', 2, 1) . PHP_EOL; // stick echo substr_replace('stack', 'u', -3, 1) . PHP_EOL; // stuck echo substr_replace('stack', 'o', 1, 2) . PHP_EOL; // sock echo substr_replace('stack', 'ge', -2, 2) . PHP_EOL; // stage echo substr_replace('stack', 'bri', 0, 3) . PHP_EOL; // brick echo substr_replace('stack', 'hre', 1, -1) . PHP_EOL; // shrek echo substr_replace('stack', 'hre', -4, -1) . PHP_EOL; // shrek echo substr_replace('stack', 'y', 3, 0) . PHP_EOL; // stayck ...consume no bytes echo substr_replace('stack', 'y', 3) . PHP_EOL; // stay ...consume remaining bytes echo substr_replace('voilà', 'ci', -2) . PHP_EOL; // voilci ...à has two bytes echo substr_replace('voilà', 'ci', -3) . PHP_EOL; // voici ...à has two bytes echo substr_replace('sûreté', '', 4) . PHP_EOL; // sûr ...û has two bytes

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.5.10.0090.01016.57
8.5.00.0120.00919.71
8.4.160.0110.01223.84
8.4.150.0020.00114.05
8.4.140.0100.01317.30
8.4.130.0120.00617.67
8.4.120.0080.00820.30
8.4.110.0100.01122.60
8.4.100.0060.00318.71
8.4.90.0110.00918.72
8.4.80.0100.00519.41
8.4.70.0130.00617.88
8.4.60.0100.00918.77
8.4.50.0090.01018.47
8.4.40.0100.01017.64
8.4.30.0130.00618.59
8.4.20.0130.00717.81
8.4.10.0120.00419.24
8.3.280.0120.00818.31
8.3.270.0140.00616.51
8.3.260.0110.00816.56
8.3.250.0160.00219.00
8.3.240.0110.00616.54
8.3.230.0110.00916.68
8.3.220.0030.00517.11
8.3.210.0040.00416.49
8.3.200.0050.00416.55
8.3.190.0090.00917.12
8.3.180.0100.00916.76
8.3.170.0040.01418.99
8.3.160.0080.00018.39
8.3.150.0050.00318.30
8.3.140.0080.00020.88
8.3.130.0080.00018.26
8.3.120.0040.00419.03
8.3.110.0100.01020.94
8.3.100.0060.00324.06
8.3.90.0150.00626.77
8.3.80.0050.00517.97
8.3.70.0090.00616.75
8.3.60.0090.01218.43
8.3.50.0110.00416.59
8.3.40.0110.00320.36
8.3.30.0040.01121.79
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0000.01028.09
8.2.290.0070.01120.28
8.2.280.0110.00819.91
8.2.270.0110.00717.03
8.2.260.0060.00316.36
8.2.250.0120.00618.11
8.2.240.0040.00416.76
8.2.230.0040.00422.58
8.2.220.0000.00837.54
8.2.210.0110.00726.77
8.2.200.0090.00316.38
8.2.190.0070.01416.58
8.2.180.0040.01116.75
8.2.170.0090.00618.81
8.2.160.0100.00322.96
8.2.150.0000.00825.66
8.2.140.0000.00824.66
8.2.130.0070.00328.09
8.2.120.0080.00028.09
8.2.110.0100.00028.09
8.2.100.0120.00628.09
8.2.90.0050.00528.09
8.2.80.0040.00428.09
8.2.70.0040.00428.09
8.2.60.0040.00428.09
8.2.50.0080.00028.09
8.2.40.0050.00328.09
8.2.30.0030.00528.09
8.2.20.0080.00028.09
8.2.10.0040.00428.09
8.2.00.0040.00428.09
8.1.330.0090.01022.21
8.1.320.0120.00816.02
8.1.310.0070.01016.60
8.1.300.0040.00418.46
8.1.290.0000.00930.84
8.1.280.0060.00925.92
8.1.270.0030.01420.66
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0050.00328.09
8.1.230.0050.00328.09
8.1.220.0050.00328.09
8.1.210.0050.00328.09
8.1.200.0040.00428.09
8.1.190.0000.00828.09
8.1.180.0040.00428.09
8.1.170.0080.00028.09
8.1.160.0030.00628.09
8.1.150.0080.00028.09
8.1.140.0050.00328.09
8.1.130.0040.00428.09
8.1.120.0080.00028.09
8.1.110.0080.00028.09
8.1.100.0040.00428.09
8.1.90.0080.00028.09
8.1.80.0080.00028.09
8.1.70.0060.00328.09
8.1.60.0000.00828.09
8.1.50.0080.00028.09
8.1.40.0080.00028.09
8.1.30.0080.00028.09
8.1.20.0040.00428.09
8.1.10.0040.00428.09
8.1.00.0090.00028.09

preferences:
95.31 ms | 403 KiB | 5 Q