3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getMonths() { $monthsData = array(); $dateBegin = new \DateTime('2018-05-01'); $dateEnd = new \DateTime('2019-01-01'); while ($date->getTimestamp() < $dateEnd->getTimestamp()) { $date->format('d/m/Y'); $monthsData[] = $date; $date->add(new \DateInterval('P1M')); } ksort($monthsData); return $monthsData; } $data = getMonths(); var_dump($data);
Output for git.master_jit, git.master, rfc.property-hooks
Warning: Undefined variable $date in /in/UqcAb on line 10 Fatal error: Uncaught Error: Call to a member function getTimestamp() on null in /in/UqcAb:10 Stack trace: #0 /in/UqcAb(21): getMonths() #1 {main} thrown in /in/UqcAb on line 10
Process exited with code 255.

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:
72.76 ms | 401 KiB | 8 Q