3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $sting = "15.10.15 10:20"; $date = '20'.substr($string, 6, 2).'-'.substr($string, 3, 2).'-'.substr($string, 0, 2).' '.substr($string, 9, 2).':'.substr($string, 12, 2).':00'; var_dump( new \DateTime($date, new \DateTimeZone('UTC')));;
Output for 7.0.0 - 7.2.0
Notice: Undefined variable: string in /in/348o9 on line 4 Notice: Undefined variable: string in /in/348o9 on line 4 Notice: Undefined variable: string in /in/348o9 on line 4 Notice: Undefined variable: string in /in/348o9 on line 4 Notice: Undefined variable: string in /in/348o9 on line 4 Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (20-- ::00) at position 0 (2): Unexpected character in /in/348o9:5 Stack trace: #0 /in/348o9(5): DateTime->__construct('20-- ::00', Object(DateTimeZone)) #1 {main} thrown in /in/348o9 on line 5
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Notice: Undefined variable: string in /in/348o9 on line 4 Notice: Undefined variable: string in /in/348o9 on line 4 Notice: Undefined variable: string in /in/348o9 on line 4 Notice: Undefined variable: string in /in/348o9 on line 4 Notice: Undefined variable: string in /in/348o9 on line 4 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (20-- ::00) at position 0 (2): Unexpected character' in /in/348o9:5 Stack trace: #0 /in/348o9(5): DateTime->__construct('20-- ::00', Object(DateTimeZone)) #1 {main} thrown in /in/348o9 on line 5
Process exited with code 255.