3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $d1 = new \DateTimeImmutable('today 00:00', new \DateTimeZone('Europe/Prague')); $d2 = new \DateTimeImmutable('tomorrow 00:00', new \DateTimeZone('Europe/London')); var_dump($d1->diff($d2)->format('%yy,%mm,%dd,%hh,%im,%ss'));
based on a4erD
Output for 5.5.8 - 7.2.0
string(17) "0y,0m,1d,1h,0m,0s"
Output for 5.5.0 - 5.5.7
Fatal error: DateTime::diff() must be derived from DateTimeImmutable::diff in Unknown on line 0
Process exited with code 255.
Output for 5.3.0 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/iHNFJ on line 3
Process exited with code 255.
Output for 5.0.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/iHNFJ on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/iHNFJ on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/iHNFJ on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/iHNFJ on line 4 Fatal error: Class 'DateTimeImmutable' not found in /in/iHNFJ on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/iHNFJ on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/iHNFJ on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/iHNFJ on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/iHNFJ on line 4 Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/iHNFJ 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/iHNFJ on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/iHNFJ on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/iHNFJ on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/iHNFJ on line 4 Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/iHNFJ 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/iHNFJ on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/iHNFJ on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/iHNFJ on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/iHNFJ on line 4 Parse error: parse error in /in/iHNFJ on line 6
Process exited with code 255.