3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); function toDateInterval(string $interval): DateInterval { if (false === ($res = DateInterval::createFromDateString($interval))) { throw new Exception('Invalid string.'); } return $res; } var_dump(toDateInterval('foobar'));

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.0070.01320.63
8.4.110.0120.00818.79
8.4.100.0160.00517.75
8.4.90.0070.01217.91
8.4.80.0080.00317.98
8.4.70.0150.00517.95
8.4.60.0070.01320.70
8.4.50.0140.00618.60
8.4.40.0090.01217.65
8.4.30.0000.01520.00
8.4.20.0100.00719.99
8.4.10.0030.00619.65
8.3.250.0090.00718.89
8.3.240.0110.00816.72
8.3.230.0130.00616.64
8.3.220.0070.01116.99
8.3.210.0110.00816.68
8.3.200.0060.00716.69
8.3.190.0060.00417.06
8.3.180.0130.00618.88
8.3.170.0040.01119.00
8.3.160.0110.00818.63
8.3.150.0040.01318.82
8.3.140.0030.00620.66
8.3.130.0060.00318.59
8.3.120.0080.00818.73
8.3.110.0060.00320.94
8.3.100.0060.00324.06
8.3.90.0050.00326.77
8.3.80.0060.00316.88
8.3.70.0110.00716.58
8.3.60.0060.00916.73
8.3.50.0160.00620.19
8.3.40.0100.01019.14
8.3.30.0080.00818.85
8.3.20.0040.00424.18
8.3.10.0030.00624.66
8.3.00.0060.00326.16
8.2.290.0100.00920.41
8.2.280.0150.00420.16
8.2.270.0070.01116.46
8.2.260.0040.00417.30
8.2.250.0120.00916.85
8.2.240.0040.00418.86
8.2.230.0160.00022.58
8.2.220.0100.00037.54
8.2.210.0000.00826.77
8.2.200.0000.01116.88
8.2.190.0060.01617.00
8.2.180.0150.00025.92
8.2.170.0110.00419.16
8.2.160.0110.00322.96
8.2.150.0000.00825.66
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0080.00021.13
8.2.110.0070.00422.27
8.2.100.0060.00617.84
8.2.90.0030.00522.28
8.2.80.0040.00417.97
8.2.70.0000.00818.04
8.2.60.0000.00718.03
8.2.50.0030.00718.10
8.2.40.0070.00020.77
8.2.30.0080.00018.04
8.2.20.0040.00420.42
8.2.10.0040.00417.90
8.2.00.0080.00019.35
8.1.330.0130.00716.93
8.1.320.0100.01018.25
8.1.310.0030.00516.85
8.1.300.0090.00018.17
8.1.290.0060.00318.88
8.1.280.0060.00925.92
8.1.270.0050.00323.99
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0060.00322.61
8.1.230.0030.00720.89
8.1.220.0060.00317.74
8.1.210.0080.00019.02
8.1.200.0000.00917.38
8.1.190.0050.00317.38
8.1.180.0040.00418.10
8.1.170.0000.00918.78
8.1.160.0000.00718.99
8.1.150.0060.00618.81
8.1.140.0070.00017.58
8.1.130.0080.00018.86
8.1.120.0070.00317.49
8.1.110.0030.00517.52
8.1.100.0050.00317.53
8.1.90.0080.00017.60
8.1.80.0040.00417.55
8.1.70.0030.00317.64
8.1.60.0040.00417.62
8.1.50.0000.00817.50
8.1.40.0040.00417.65
8.1.30.0060.00317.77
8.1.20.0100.00717.68
8.1.10.0220.00517.63
8.1.00.0220.00517.61
8.0.300.0040.00420.01
8.0.290.0070.00017.00
8.0.280.0000.00718.34
8.0.270.0040.00416.89
8.0.260.0000.00818.34
8.0.250.0040.00417.12
8.0.240.0000.00817.09
8.0.230.0030.00317.11
8.0.220.0030.00517.06
8.0.210.0070.00017.04
8.0.200.0030.00617.16
8.0.190.0040.00416.99
8.0.180.0080.00017.13
8.0.170.0040.00417.01
8.0.160.0040.00417.02
8.0.150.0170.00517.00
8.0.140.0190.00317.00
8.0.130.0160.00516.99
8.0.120.0140.00517.10
8.0.110.0090.00717.06
8.0.100.0150.00317.05
8.0.90.0180.00217.07
8.0.80.0180.00317.08
8.0.70.0150.00717.09
8.0.60.0150.00516.96
8.0.50.0150.00617.03
8.0.30.0190.00217.08
8.0.20.0190.00417.18
8.0.10.0160.00517.13
7.4.330.0000.00515.55
7.4.320.0060.00016.76
7.4.300.0060.00016.62
7.4.290.0070.00016.57
7.4.280.0000.00716.73
7.4.270.0200.00616.52
7.4.260.0200.00316.67
7.4.250.0200.00316.70
7.4.240.0160.00316.66
7.4.230.0100.00916.67
7.4.220.0140.00716.58
7.4.210.0170.00416.67
7.4.200.0180.00316.68
7.4.190.0170.00616.66
7.4.180.0180.00216.74
7.4.160.0130.00716.71
7.4.150.0140.00616.55
7.4.140.0170.00316.63
7.4.130.0200.00216.57
7.4.120.0160.00516.56
7.4.110.0140.00616.57
7.4.100.0160.00616.72
7.4.90.0130.00716.53
7.4.80.0180.00216.57
7.4.70.0140.00516.61
7.4.60.0140.00516.58
7.4.50.0130.00616.50
7.4.40.0160.00316.45
7.4.30.0150.00416.42
7.4.20.0120.00516.54
7.4.10.0150.00416.60
7.4.00.0090.00616.60

preferences:
27.86 ms | 403 KiB | 5 Q