3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function X($Format) { return(new DateTime($Format)); } echo X()->format('01/m/Y');
Output for 7.1.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function X(), 0 passed in /in/Rfhi9 on line 6 and exactly 1 expected in /in/Rfhi9:2 Stack trace: #0 /in/Rfhi9(6): X() #1 {main} thrown in /in/Rfhi9 on line 2
Process exited with code 255.
Output for 5.2.0 - 7.0.14
Warning: Missing argument 1 for X(), called in /in/Rfhi9 on line 6 and defined in /in/Rfhi9 on line 2 Notice: Undefined variable: Format in /in/Rfhi9 on line 4 01/03/2014
Output for 5.1.0 - 5.1.6
Warning: Missing argument 1 for X(), called in /in/Rfhi9 on line 6 and defined in /in/Rfhi9 on line 2 Fatal error: Class 'DateTime' not found in /in/Rfhi9 on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Warning: Missing argument 1 for X() in /in/Rfhi9 on line 2 Fatal error: Class 'DateTime' not found in /in/Rfhi9 on line 4
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/Rfhi9 on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/Rfhi9 on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `','' or `';'' in /in/Rfhi9 on line 6
Process exited with code 255.