1--TEST--
2Test date_create() function : basic functionality
3--FILE--
4<?php
5/* Prototype  : DateTime date_create  ([ string $time  [, DateTimeZone $timezone  ]] )
6 * Description: Returns new DateTime object
7 * Source code: ext/date/php_date.c
8 * Alias to functions: DateTime::__construct
9 */
10
11//Set the default time zone
12date_default_timezone_set("Europe/London");
13
14echo "*** Testing date_create() : basic functionality ***\n";
15
16var_dump( date_create() );
17
18var_dump( date_create("GMT") );
19var_dump( date_create("2005-07-14 22:30:41") );
20var_dump( date_create("2005-07-14 22:30:41 GMT") );
21
22?>
23===DONE===
24--EXPECTF--
25*** Testing date_create() : basic functionality ***
26object(DateTime)#%d (3) {
27  ["date"]=>
28  string(19) "%s"
29  ["timezone_type"]=>
30  int(3)
31  ["timezone"]=>
32  string(13) "Europe/London"
33}
34object(DateTime)#%d (3) {
35  ["date"]=>
36  string(19) "%s"
37  ["timezone_type"]=>
38  int(2)
39  ["timezone"]=>
40  string(3) "GMT"
41}
42object(DateTime)#%d (3) {
43  ["date"]=>
44  string(19) "2005-07-14 22:30:41"
45  ["timezone_type"]=>
46  int(3)
47  ["timezone"]=>
48  string(13) "Europe/London"
49}
50object(DateTime)#%d (3) {
51  ["date"]=>
52  string(19) "2005-07-14 22:30:41"
53  ["timezone_type"]=>
54  int(2)
55  ["timezone"]=>
56  string(3) "GMT"
57}
58===DONE===