3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $now = date("Y-m-d"); $from = new DateTime( $now ); echo $from; $from->modify('first day of this month'); $from = $from->format("Y-m-d"); $to = new DateTime( $now ); $to->modify('first day of next month'); $from = $to->format("Y-m-d"); echo $from; echo $to;
based on EABlV
Output for 7.1.0 - 7.2.0
Recoverable fatal error: Object of class DateTime could not be converted to string in /in/PEpjT on line 4
Process exited with code 255.
Output for 5.4.0 - 7.0.20
Catchable fatal error: Object of class DateTime could not be converted to string in /in/PEpjT on line 4
Process exited with code 255.