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 h62Ce
Output for 5.3.0 - 5.5.9, 5.5.18 - 5.5.38, 5.6.1 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
Output for 5.5.10 - 5.5.16, 5.6.0
CST6CDT returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(CST6CDT)\nCuba returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Cuba)\nEgypt returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Egypt)\nEire returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Eire)\nEST5EDT returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(EST5EDT)\nFactory returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Factory)\nGB-Eire returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(GB-Eire)\nGMT0 returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(GMT0)\nGreenwich returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Greenwich)\nHongkong returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Hongkong)\nIceland returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Iceland)\nIran returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Iran)\nIsrael returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Israel)\nJamaica returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Jamaica)\nJapan returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Japan)\nKwajalein returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Kwajalein)\nLibya returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Libya)\nMST7MDT returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(MST7MDT)\nNavajo returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Navajo)\nNZ-CHAT returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(NZ-CHAT)\nPoland returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Poland)\nPortugal returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Portugal)\nPST8PDT returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(PST8PDT)\nSingapore returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Singapore)\nTurkey returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Turkey)\nUniversal returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Universal)\nW-SU returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(W-SU)\nZulu returned by \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC).\nBut invalid for: new \DateTimeZone(Zulu)\n
Output for 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hR9eg on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hR9eg on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hR9eg on line 8 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hR9eg on line 9 Fatal error: Undefined class constant 'ALL_WITH_BC' in /in/hR9eg 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/hR9eg on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hR9eg on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hR9eg on line 8 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hR9eg on line 9 Fatal error: Class 'DateTimeZone' not found in /in/hR9eg 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/hR9eg on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hR9eg on line 3 Parse error: syntax error, unexpected ')', expecting '(' in /in/hR9eg 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/hR9eg on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hR9eg on line 3 Parse error: parse error, unexpected ')', expecting '(' in /in/hR9eg 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/hR9eg on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hR9eg on line 3 Parse error: parse error, expecting `'('' in /in/hR9eg on line 3
Process exited with code 255.