3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getDaysLeft(DateTimeImmutable $now, DateTimeImmutable $until): void { $diff = $now->diff($until); var_dump( ($diff->invert ? -1 : 1) * ($diff->days + $diff->h / 24 + $diff->i / (24 * 60) + $diff->s / (24 * 60 * 60)) ); var_dump(((int) $diff->format("%r1")) * ($diff->format("%a") + $diff->format("%h") / 24 + $diff->format("%i") / (24 * 60) + $diff->format("%s") / (24 * 60 * 60))); } // subscription has expired half a day ago getDaysLeft(new DateTimeImmutable("2023-11-24 00:00:00"), new DateTimeImmutable("2023-11-23 12:00:00")); // subscription will expire in hald a day getDaysLeft(new DateTimeImmutable("2023-11-24 00:00:00"), new DateTimeImmutable("2023-11-24 12:00:00"));

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.00.0110.01320.03
8.4.150.0020.00114.05
8.4.140.0150.00717.82
8.4.130.0130.00719.04
8.4.120.0040.00624.17
8.4.110.0140.00619.08
8.4.100.0140.00718.89
8.4.90.0110.00820.51
8.4.80.0060.00218.91
8.4.70.0120.00718.91
8.4.60.0100.01019.04
8.4.50.0120.00718.72
8.4.40.0180.00317.76
8.4.30.0130.00718.74
8.4.20.0070.01019.80
8.4.10.0160.00019.33
8.3.280.0100.01218.60
8.3.270.0100.01116.76
8.3.260.0080.00816.63
8.3.250.0110.00818.89
8.3.240.0060.00417.41
8.3.230.0110.01016.79
8.3.220.0120.00619.08
8.3.210.0060.00916.75
8.3.200.0040.00416.74
8.3.190.0020.00617.27
8.3.180.0110.00718.95
8.3.170.0140.00416.77
8.3.160.0120.00617.30
8.3.150.0150.00316.87
8.3.140.0100.01020.72
8.3.130.0050.00318.64
8.3.120.0040.00420.57
8.3.110.0040.00420.94
8.3.100.0060.00324.06
8.3.90.0100.00026.77
8.3.80.0030.00618.43
8.3.70.0120.00316.63
8.3.60.0140.00318.22
8.3.50.0110.00416.88
8.3.40.0070.00720.31
8.3.30.0140.00021.77
8.3.20.0000.00824.18
8.3.10.0050.00324.66
8.3.00.0170.00326.16
8.2.290.0140.00520.34
8.2.280.0050.00318.73
8.2.270.0100.01016.79
8.2.260.0050.00316.84
8.2.250.0000.00816.95
8.2.240.0080.00317.13
8.2.230.0000.00822.58
8.2.220.0080.00037.54
8.2.210.0000.00826.77
8.2.200.0060.00316.63
8.2.190.0120.00618.54
8.2.180.0130.01316.88
8.2.170.0190.00019.04
8.2.160.0100.00322.96
8.2.150.0070.00025.66
8.2.140.0030.00524.66
8.2.130.0000.00828.09
8.2.120.0070.00026.35
8.1.330.0100.00921.91
8.1.320.0100.00916.40
8.1.310.0150.00416.32
8.1.300.0120.00318.59
8.1.290.0030.00630.84
8.1.280.0030.01525.92
8.1.270.0000.00924.66
8.1.260.0000.00828.09
8.1.250.0030.00528.09

preferences:
30.21 ms | 403 KiB | 5 Q