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"));
Output for git.master, git.master_jit, rfc.property-hooks
float(-0.5) float(-0.5) float(0.5) float(0.5)

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
82.07 ms | 405 KiB | 5 Q