3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dates = [ '2019-08-19 00:00:00', '2019-08-20 00:00:00', '2019-08-21 00:00:00', '2019-08-21 00:00:00', '2019-08-21 00:00:00', '2019-08-22 00:00:00', '2019-08-22 00:00:00', '2019-08-22 00:00:00', '2019-08-23 00:00:00', '2019-08-23 00:00:00', '2019-08-23 00:00:00', '2019-08-24 00:00:00', '2019-08-24 00:00:00', '2019-08-25 00:00:00', '2019-08-25 00:00:00', ]; $lastDay = ""; $i = -1; foreach ($dates as $date){ $i++; $dateTime = new DateTime($date); if ($lastDay != $dateTime->format("d") && $i != 0){ //$dates[$i - 1]['lastDay'] = true; echo ($i - 1) . " is a last row in a day\n"; } $lastDay = $dateTime->format("d"); } echo $i . " is a last row in a day\n";; // last row must be a last row in a day also
Output for git.master, git.master_jit, rfc.property-hooks
0 is a last row in a day 1 is a last row in a day 4 is a last row in a day 7 is a last row in a day 10 is a last row in a day 12 is a last row in a day 14 is a last row in a day

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:
177.06 ms | 405 KiB | 5 Q