3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tz = new DateTimeZone("Europe/Zurich"); $dt1 = new Datetime('2019-01-01', $tz); $dt2 = new Datetime('2019-05-01', $tz); echo 'EU/ZU : ' . $dt1->diff($dt2)->format('%a') . ' Days' . PHP_EOL; echo 'EU/ZU : ' . $dt1->diff($dt2)->format('%m') . ' Months' . PHP_EOL . PHP_EOL; $tz = new DateTimeZone("UTC"); $dt1 = new Datetime('2019-01-01', $tz); $dt2 = new Datetime('2019-05-01', $tz); echo 'UTC : ' . $dt1->diff($dt2)->format('%a') . ' Days' . PHP_EOL; echo 'UTC : ' . $dt1->diff($dt2)->format('%m') . ' Months' . PHP_EOL;

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for branch master
EU/ZU : 120 Days EU/ZU : 3 Months UTC : 120 Days UTC : 4 Months
Output for branch master_jit
EU/ZU : 120 Days EU/ZU : 3 Months UTC : 120 Days UTC : 4 Months
Output for branch enumerations
EU/ZU : 120 Days EU/ZU : 3 Months UTC : 120 Days UTC : 4 Months

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