3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = \DateTime::createFromFormat('Y-n-j H:i', strval($year+1)."-$month-1 00:00"); echo $date->format('d-m-Y H:i');
Output for 7.0.0 - 7.2.0
Notice: Undefined variable: year in /in/dkoGp on line 3 Notice: Undefined variable: month in /in/dkoGp on line 3 Fatal error: Uncaught Error: Call to a member function format() on boolean in /in/dkoGp:5 Stack trace: #0 {main} thrown in /in/dkoGp on line 5
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Notice: Undefined variable: year in /in/dkoGp on line 3 Notice: Undefined variable: month in /in/dkoGp on line 3 Fatal error: Call to a member function format() on boolean in /in/dkoGp on line 5
Process exited with code 255.
Output for 5.3.22 - 5.5.35
Notice: Undefined variable: year in /in/dkoGp on line 3 Notice: Undefined variable: month in /in/dkoGp on line 3 Fatal error: Call to a member function format() on a non-object in /in/dkoGp on line 5
Process exited with code 255.