3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $now = new \DateTime('now'); $a = \DateTime::createFromFormat(); echo $now->diff(new \DateTime('1981-02-10'))->y;
Output for 7.3.0rc3 - 7.3.0rc4
Warning: DateTime::createFromFormat() expects at least 2 parameters, 0 given in /in/Oo66O on line 5 33
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Oo66O on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Oo66O on line 5 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Oo66O on line 6 Fatal error: Class 'DateTime' not found in /in/Oo66O on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Oo66O on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Oo66O on line 5 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Oo66O on line 6 Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/Oo66O on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Oo66O on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Oo66O on line 5 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Oo66O on line 6 Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/Oo66O on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Oo66O on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Oo66O on line 5 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Oo66O on line 6 Parse error: parse error, expecting `','' or `';'' in /in/Oo66O on line 6
Process exited with code 255.