3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = DateTime::createFromFormat('d-m-Y', '25-12-2013'); $end = DateTime::createFromFormat('d-m-Y', '26-12-2013'); $dates = array('24-12-2013','25-12-2013','26-12-2014','27-12-2013'); $matches = array(); foreach ($dates as $date) { $date2 = DateTime::createFromFormat('d-m-Y', $date); echo var_dump($date2); if ($date2 >= $start && $date2 <= $end) { $matches[] = $date; } } print_r($matches);
Output for git.master, git.master_jit, rfc.property-hooks
object(DateTime)#3 (3) { ["date"]=> string(26) "2013-12-24 15:26:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#4 (3) { ["date"]=> string(26) "2013-12-25 15:26:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2014-12-26 15:26:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#4 (3) { ["date"]=> string(26) "2013-12-27 15:26:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Array ( [0] => 25-12-2013 )

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:
57.12 ms | 403 KiB | 8 Q