3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $quarterMonth = floor(0 / 3) * 3; $quarterYear = date('Y'); if ($quarterMonth == 0) { $quarterMonth = 12; $quarterYear -= 1; } var_dump(new \DateTime(implode('-', array($quarterYear, $quarterMonth, cal_days_in_month(CAL_GREGORIAN, $quarterMonth, $quarterYear)))));
based on PkN1a
Output for 7.1.20 - 7.3.0beta1
Fatal error: Uncaught Error: Call to undefined function cal_days_in_month() in /in/IbNsd:10 Stack trace: #0 {main} thrown in /in/IbNsd on line 10
Process exited with code 255.
Output for 5.5.14 - 7.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-31 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.0 - 5.5.13
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-31 00:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }