3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = 43; echo (new DateTime('Jan '.$x))->format('jS');
based on Ds9T8
Output for 7.1.10 - 7.2.0
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (Jan 43) at position 4 (4): Unexpected character in /in/5eb6N:5 Stack trace: #0 /in/5eb6N(5): DateTime->__construct('Jan 43') #1 {main} thrown in /in/5eb6N on line 5
Process exited with code 255.
Output for 7.0.0 - 7.1.7
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (Jan 43) at position 5 (3): Unexpected character in /in/5eb6N:5 Stack trace: #0 /in/5eb6N(5): DateTime->__construct('Jan 43') #1 {main} thrown in /in/5eb6N on line 5
Process exited with code 255.
Output for 5.4.11 - 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (Jan 43) at position 5 (3): Unexpected character' in /in/5eb6N:5 Stack trace: #0 /in/5eb6N(5): DateTime->__construct('Jan 43') #1 {main} thrown in /in/5eb6N on line 5
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/5eb6N on line 5
Process exited with code 255.