bug43808.phpt 857 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --TEST--
  2. Bug #43808 (date_create never fails (even when it should))
  3. --FILE--
  4. <?php
  5. $date = date_create('asdfasdf');
  6. if ($date instanceof DateTime) {
  7. echo "this is wrong, should be bool";
  8. }
  9. var_dump( $date );
  10. var_dump( DateTime::getLastErrors() );
  11. var_dump( date_get_last_errors() );
  12. ?>
  13. --EXPECT--
  14. bool(false)
  15. array(4) {
  16. ["warning_count"]=>
  17. int(1)
  18. ["warnings"]=>
  19. array(1) {
  20. [6]=>
  21. string(29) "Double timezone specification"
  22. }
  23. ["error_count"]=>
  24. int(1)
  25. ["errors"]=>
  26. array(1) {
  27. [0]=>
  28. string(47) "The timezone could not be found in the database"
  29. }
  30. }
  31. array(4) {
  32. ["warning_count"]=>
  33. int(1)
  34. ["warnings"]=>
  35. array(1) {
  36. [6]=>
  37. string(29) "Double timezone specification"
  38. }
  39. ["error_count"]=>
  40. int(1)
  41. ["errors"]=>
  42. array(1) {
  43. [0]=>
  44. string(47) "The timezone could not be found in the database"
  45. }
  46. }