3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $year = 2012; $month = 1; $day = -5; $date = \DateTimeImmutable::createFromFormat('Y-m-d', "{$year}-{$month}-{$day}"); var_dump($date->format('Y-m-d H:i:s'));
based on 6fGP6
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to a member function format() on boolean in /in/foHPp:9 Stack trace: #0 {main} thrown in /in/foHPp on line 9
Process exited with code 255.
Output for 5.6.7 - 5.6.28
Fatal error: Call to a member function format() on boolean in /in/foHPp on line 9
Process exited with code 255.
Output for 5.5.24 - 5.5.35
Fatal error: Call to a member function format() on a non-object in /in/foHPp on line 9
Process exited with code 255.
Output for 5.3.18 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/foHPp on line 7
Process exited with code 255.