bug51819.phpt 815 B

12345678910111213141516171819202122232425262728293031323334
  1. --TEST--
  2. Bug #51819 (Case discrepancy in timezone names cause Uncaught exception and fatal error)
  3. --FILE--
  4. <?php
  5. date_default_timezone_set('UTC');
  6. $aTzAbbr = timezone_abbreviations_list();
  7. $aTz = array();
  8. foreach (array_keys($aTzAbbr) as $sKey) {
  9. foreach (array_keys($aTzAbbr[$sKey]) as $iIndex) {
  10. $sTz = $aTzAbbr[$sKey][$iIndex]['timezone_id'];
  11. if (! in_array($sTz, $aTz)) {
  12. array_push($aTz, $sTz);
  13. }
  14. }
  15. }
  16. foreach ($aTz as $sTz) {
  17. $sDate = '2010-05-15 00:00:00 ' . $sTz;
  18. try {
  19. $oDateTime = new DateTime($sDate);
  20. } catch (Exception $oException) {
  21. var_dump($oException->getMessage());
  22. print_r(DateTime::getLastErrors());
  23. }
  24. }
  25. var_dump('this should be the only output');
  26. ?>
  27. --EXPECT--
  28. string(30) "this should be the only output"