3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "My starting year is {{current_year}} and my grad year is {{grad_year}}"; array_walk([ // List of placeholders and their values "{{current_year}}" => date("Y"), "{{grad_year}}" => date("Y") + 4 ], function($value, $key) use ($string) { $string = str_replace($key, $value, $string); }); echo $string;

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.20.0380.01617.91
8.4.10.0410.00717.60
8.3.150.0320.01816.34
8.3.140.0340.00616.45
8.3.130.0290.01816.40
8.3.120.0310.00916.63
8.3.110.0420.00016.57
8.3.100.0400.00716.77
8.3.90.0430.00316.25
8.3.80.0300.00316.78
8.3.70.0250.00416.42
8.3.60.0460.00416.62
8.3.50.0390.00716.50
8.3.40.0360.00917.57
8.3.30.0250.01517.63
8.3.20.0350.00417.53
8.3.10.0310.00617.54
8.3.00.0150.00717.51
8.2.270.0210.01816.41
8.2.260.0270.00716.92
8.2.250.0230.00816.97
8.2.240.0290.01016.54
8.2.230.0340.00416.30
8.2.220.0380.00016.39
8.2.210.0340.00416.23
8.2.200.0380.00016.59
8.2.190.0360.00316.64
8.2.180.0330.00616.57
8.2.170.0460.00317.72
8.2.160.0250.01317.83
8.2.150.0230.00617.75
8.2.140.0260.01017.51
8.2.130.0310.00917.56
8.2.120.0290.01217.66
8.2.110.0360.00017.62
8.2.100.0280.01117.48
8.2.90.0380.00817.39
8.2.80.0200.01417.77
8.2.70.0190.01617.76
8.2.60.0370.00317.54
8.2.50.0250.02117.49
8.2.40.0330.00417.57
8.2.30.0290.00717.71
8.2.20.0210.02117.61
8.2.10.0220.01517.56
8.2.00.0310.00617.45

preferences:
26.72 ms | 403 KiB | 5 Q