date_parse_basic1.phpt 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. --TEST--
  2. Test date_parse() function : basic functionality
  3. --FILE--
  4. <?php
  5. /* Prototype : array date_parse ( string $date )
  6. * Description: Returns associative array with detailed info about given date.
  7. * Source code: ext/date/php_date.c
  8. */
  9. //Set the default time zone
  10. date_default_timezone_set("Europe/London");
  11. echo "*** Testing date_parse() : basic functionality ***\n";
  12. var_dump( date_parse("2009-02-27 10:00:00.5") );
  13. var_dump( date_parse("10:00:00.5") );
  14. var_dump( date_parse("2009-02-27") );
  15. ?>
  16. ===DONE===
  17. --EXPECT--
  18. *** Testing date_parse() : basic functionality ***
  19. array(12) {
  20. ["year"]=>
  21. int(2009)
  22. ["month"]=>
  23. int(2)
  24. ["day"]=>
  25. int(27)
  26. ["hour"]=>
  27. int(10)
  28. ["minute"]=>
  29. int(0)
  30. ["second"]=>
  31. int(0)
  32. ["fraction"]=>
  33. float(0.5)
  34. ["warning_count"]=>
  35. int(0)
  36. ["warnings"]=>
  37. array(0) {
  38. }
  39. ["error_count"]=>
  40. int(0)
  41. ["errors"]=>
  42. array(0) {
  43. }
  44. ["is_localtime"]=>
  45. bool(false)
  46. }
  47. array(12) {
  48. ["year"]=>
  49. bool(false)
  50. ["month"]=>
  51. bool(false)
  52. ["day"]=>
  53. bool(false)
  54. ["hour"]=>
  55. int(10)
  56. ["minute"]=>
  57. int(0)
  58. ["second"]=>
  59. int(0)
  60. ["fraction"]=>
  61. float(0.5)
  62. ["warning_count"]=>
  63. int(0)
  64. ["warnings"]=>
  65. array(0) {
  66. }
  67. ["error_count"]=>
  68. int(0)
  69. ["errors"]=>
  70. array(0) {
  71. }
  72. ["is_localtime"]=>
  73. bool(false)
  74. }
  75. array(12) {
  76. ["year"]=>
  77. int(2009)
  78. ["month"]=>
  79. int(2)
  80. ["day"]=>
  81. int(27)
  82. ["hour"]=>
  83. bool(false)
  84. ["minute"]=>
  85. bool(false)
  86. ["second"]=>
  87. bool(false)
  88. ["fraction"]=>
  89. bool(false)
  90. ["warning_count"]=>
  91. int(0)
  92. ["warnings"]=>
  93. array(0) {
  94. }
  95. ["error_count"]=>
  96. int(0)
  97. ["errors"]=>
  98. array(0) {
  99. }
  100. ["is_localtime"]=>
  101. bool(false)
  102. }
  103. ===DONE===