3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tzIdentifiers = \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC); foreach ($tzIdentifiers as $tzid) { try { $tz = new \DateTimeZone($tzid); } catch(\Exception $e) { echo $tzid . " returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC)." . "\n"; echo "But invalid for: new \DateTimeZone(" . $tzid . ")" . "\n"; } }
based on hR9eg
Output for 5.3.0 - 7.1.0
Output for 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/CsZE0 on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/CsZE0 on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/CsZE0 on line 8 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/CsZE0 on line 9 Fatal error: Undefined class constant 'ALL_WITH_BC' in /in/CsZE0 on line 3
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/CsZE0 on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/CsZE0 on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/CsZE0 on line 8 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/CsZE0 on line 9 Fatal error: Class 'DateTimeZone' not found in /in/CsZE0 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/CsZE0 on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/CsZE0 on line 3 Parse error: syntax error, unexpected ')', expecting '(' in /in/CsZE0 on line 3
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/CsZE0 on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/CsZE0 on line 3 Parse error: parse error, unexpected ')', expecting '(' in /in/CsZE0 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/CsZE0 on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/CsZE0 on line 3 Parse error: parse error, expecting `'('' in /in/CsZE0 on line 3
Process exited with code 255.