3v4l.org

run code in 200+ PHP versions simultaneously
<?php //Source: https://bugs.php.net/bug.php?id=67634 $date = \DateTimeImmutable::createFromFormat(\DateTime::ATOM, '2019-11-03T01:00:00-05:00')->setTimezone(new \DateTimeZone('America/New_York')); var_dump($date->format(\DateTimeImmutable::ATOM)); $date->getTimestamp(); var_dump($date->format(\DateTimeImmutable::ATOM));
based on M5Hcu
Output for 7.2.0 - 7.4.0rc2
string(25) "2019-11-03T01:00:00-05:00" string(25) "2019-11-03T01:00:00-04:00"
Output for 7.0.0 - 7.1.32
Fatal error: Uncaught Error: Undefined class constant 'ATOM' in /in/uk3fZ:6 Stack trace: #0 {main} thrown in /in/uk3fZ on line 6
Process exited with code 255.
Output for 5.5.0 - 5.6.40
Fatal error: Undefined class constant 'ATOM' in /in/uk3fZ on line 6
Process exited with code 255.
Output for 5.3.0 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/uk3fZ on line 4
Process exited with code 255.
Output for 5.0.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/uk3fZ on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/uk3fZ on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/uk3fZ on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/uk3fZ on line 6 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/uk3fZ on line 8 Fatal error: Class 'DateTimeImmutable' not found in /in/uk3fZ on line 4
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/uk3fZ on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/uk3fZ on line 4 Parse error: syntax error, unexpected ',', expecting '(' in /in/uk3fZ on line 4
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/uk3fZ on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/uk3fZ on line 4 Parse error: parse error, unexpected ',', expecting '(' in /in/uk3fZ on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/uk3fZ on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/uk3fZ on line 4 Parse error: parse error, expecting `'('' in /in/uk3fZ on line 4
Process exited with code 255.