3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '+6 year +1 month'; preg_match('/\+(\d+)\smonth/', $string, $monthMatch); preg_match('/\+(\d+)\syear/', $string, $yearMatch); $monthInterval = isset($monthMatch[1]) ? (int)$monthMatch[1] : 0; $yearInterval = isset($yearMatch[1]) ? (int)$yearMatch[1] : 0; var_dump(date('Y-n-j', strtotime('+1 year +6 month'))); var_dump(date('Y-n-j', strtotime('+6 month +1 year'))); ?>

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.120.0090.00019.00
8.3.110.0040.00417.05
8.3.100.0120.00316.69
8.3.90.0050.00316.76
8.3.80.0260.00630.84
8.3.70.0220.00930.84
8.3.60.0040.00830.84
8.3.50.0090.00330.84
8.3.40.0260.00330.84
8.3.30.0310.00030.84
8.3.20.0180.00730.84
8.3.10.0180.00730.84
8.3.00.0210.00430.84
8.2.240.0030.00617.60
8.2.230.0000.00820.94
8.2.220.0080.00637.54
8.2.210.0050.00526.77
8.2.200.0190.00730.84
8.2.190.0220.00530.84
8.2.180.0180.00630.84
8.2.170.0210.00630.84
8.2.160.0180.00530.84
8.2.150.0200.00430.84
8.2.140.0170.00730.84
8.2.130.0220.00330.84
8.2.120.0240.00030.84
8.2.110.0220.00630.84
8.2.100.0190.00630.84
8.2.90.0110.01130.84
8.2.80.0220.00330.84
8.2.70.0240.00330.84
8.2.60.0210.00630.84
8.2.50.0210.00630.84
8.2.40.0170.00730.84
8.2.30.0150.01030.84
8.2.20.0160.00630.84
8.2.10.0140.00730.84
8.2.00.0220.00430.84
8.1.300.0060.00318.53
8.1.290.0280.00430.84
8.1.280.0260.01530.84
8.1.270.0330.01530.84
8.1.260.0270.01930.84
8.1.250.0370.01030.84
8.1.240.0280.01230.84
8.1.230.0290.01130.84
8.1.220.0180.01430.84
8.1.210.0350.01130.84
8.1.200.0230.01530.84
8.1.190.0250.01330.84
8.1.180.0310.00430.84
8.1.170.0440.00330.84
8.1.160.0340.00830.84
8.1.150.0250.00930.84
8.1.140.0240.01030.84
8.1.130.0340.00630.84
8.1.120.0250.00230.84
8.1.110.0210.00030.84
8.1.100.0150.00630.84
8.1.90.0350.00030.84
8.1.80.0180.00830.84
8.1.70.0350.00430.84
8.1.60.0400.00730.84
8.1.50.0420.01030.84
8.1.40.0290.00030.84
8.1.30.0190.00430.84
8.1.20.0220.00430.84
8.1.10.0300.01030.84
8.1.00.0390.00330.84

preferences:
31.69 ms | 403 KiB | 5 Q