3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo $datetime = DateTime::createFromFormat('Ymd', date("Ymd")); echo $daynum = date("w", strtotime($datetime->format('D')));
based on FZHe1
Output for 7.1.0 - 7.3.0beta1
Recoverable fatal error: Object of class DateTime could not be converted to string in /in/ErgQn on line 3
Process exited with code 255.
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.0.27
Catchable fatal error: Object of class DateTime could not be converted to string in /in/ErgQn on line 3
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: Object of class DateTime could not be converted to string in /in/ErgQn:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught Error: Object of class DateTime could not be converted to string in /in/ErgQn:3 Stack trace: #0 {main}
Process exited with code 255.