3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myArray = ['yellow', 'green', 'red']; $myString = 'banana is ?, apple is ?, tomato is ?'; do { $myString = preg_replace( '/\?/', array_shift($myArray), $myString, 1, $count ); } while ($count && $myArray); echo $myString; echo "\n\n"; var_export($myArray);

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.130.0080.00718.97
8.4.120.0030.00724.26
8.4.110.0100.01019.05
8.4.100.0120.01018.79
8.4.90.0110.00820.57
8.4.80.0080.00818.58
8.4.70.0150.00418.38
8.4.60.0110.01018.63
8.4.50.0050.00518.55
8.4.40.0110.01117.83
8.4.30.0100.01020.85
8.4.20.0390.01017.61
8.4.10.0470.00017.61
8.3.260.0090.01116.58
8.3.250.0070.01118.66
8.3.240.0080.01017.09
8.3.230.0100.01016.91
8.3.220.0080.00518.91
8.3.210.0040.00416.52
8.3.200.0040.00516.86
8.3.190.0050.00417.12
8.3.180.0080.01117.36
8.3.170.0140.00417.02
8.3.160.0150.00318.38
8.3.150.0390.00316.92
8.3.140.0360.00916.57
8.3.130.0310.00916.59
8.3.120.0330.00716.57
8.3.110.0340.00716.73
8.3.100.0350.01116.55
8.3.90.0370.01016.33
8.3.80.0480.00416.65
8.3.70.0410.00616.60
8.3.60.0280.01816.94
8.3.50.0290.00616.84
8.3.40.0230.01617.49
8.3.30.0200.00317.57
8.3.20.0270.00917.65
8.3.10.0300.00317.60
8.3.00.0090.01317.70
8.2.290.0140.00420.36
8.2.280.0120.00718.87
8.2.270.0250.01216.66
8.2.260.0330.00616.45
8.2.250.0390.00316.32
8.2.240.0270.01516.20
8.2.230.0330.00716.23
8.2.220.0310.00316.73
8.2.210.0260.01316.58
8.2.200.0240.01416.52
8.2.190.0170.02116.76
8.2.180.0320.00616.27
8.2.170.0300.01317.52
8.2.160.0320.00717.70
8.2.150.0300.01117.55
8.2.140.0260.01317.59
8.2.130.0270.01217.50
8.2.120.0320.00917.66
8.2.110.0360.00417.31
8.2.100.0310.00317.82
8.2.90.0340.00717.61
8.2.80.0340.00617.35
8.2.70.0320.00717.51
8.2.60.0300.00917.60
8.2.50.0350.01017.44
8.2.40.0230.00617.63
8.2.30.0220.00417.63
8.2.20.0250.01117.51
8.2.10.0270.00717.29
8.2.00.0290.00717.63
8.1.320.0110.01018.04

preferences:
21.83 ms | 403 KiB | 5 Q