3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $time = "04062018"; $dateTime = datetime::createfromformat('dmY',$time); $garaga = $dateTime->format('d-M-Y'); var_dump($garaga); $rola = new DateTime($dateTime);
based on 22KnT
Output for 7.0.30 - 7.3.0alpha1
string(11) "04-Jun-2018" Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 1 to be string, object given in /in/R0PrB:8 Stack trace: #0 /in/R0PrB(8): DateTime->__construct(Object(DateTime)) #1 {main} thrown in /in/R0PrB on line 8
Process exited with code 255.
Output for hhvm-3.22.0
string(11) "04-Jun-2018" Fatal error: Uncaught exception 'Exception' with message '__construct() expects parameter 1 to be string, object given' in /in/R0PrB:-1 Stack trace: #0 /in/R0PrB(-1): DateTime->__construct() #1 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
string(11) "04-Jun-2018" Fatal error: Uncaught exception 'Exception' with message '__construct() expects parameter 1 to be string, object given' in /in/R0PrB:8 Stack trace: #0 /in/R0PrB(8): DateTime->__construct() #1 {main}
Process exited with code 255.
Output for 5.6.30
string(11) "04-Jun-2018" Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 1 to be string, object given' in /in/R0PrB:8 Stack trace: #0 /in/R0PrB(8): DateTime->__construct(Object(DateTime)) #1 {main} thrown in /in/R0PrB on line 8
Process exited with code 255.