3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $valueDate = \DateTime::createFromFormat('ymd', 151231); $bookDate = \DateTime::createFromFormat('ymd', $valueDate->format('y') . 0102); if ((int)$bookDate->format('Y') < (int)$valueDate->format('Y')) { echo 123; }
based on rM4Uh
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to a member function format() on boolean in /in/fUaOU:6 Stack trace: #0 {main} thrown in /in/fUaOU on line 6
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Fatal error: Call to a member function format() on boolean in /in/fUaOU on line 6
Process exited with code 255.
Output for 5.3.22 - 5.5.35
Fatal error: Call to a member function format() on a non-object in /in/fUaOU on line 6
Process exited with code 255.