3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = "09/2018"; $date = \DateTime::createFromFormat("01/m/Y", $string); $date = $date->modify("last day of this month"); echo $date->format("Y-m-d");
based on Y1YrR
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to a member function modify() on boolean in /in/RRBY9:5 Stack trace: #0 {main} thrown in /in/RRBY9 on line 5
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Fatal error: Call to a member function modify() on boolean in /in/RRBY9 on line 5
Process exited with code 255.
Output for 5.3.20 - 5.5.35
Fatal error: Call to a member function modify() on a non-object in /in/RRBY9 on line 5
Process exited with code 255.