2 Test date_parse() function : error conditions
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
10 //Set the default time zone
11 date_default_timezone_set("Europe/London");
13 echo "*** Testing date_parse() : error conditions ***\n";
15 echo "\n-- Testing date_parse() function with unexpected characters in \$date argument --\n";
16 $invalid_date = "2OO9-02--27 10:00?00.5";
17 var_dump( date_parse($invalid_date) );
21 *** Testing date_parse() : error conditions ***
23 -- Testing date_parse() function with unexpected characters in $date argument --
44 string(29) "Double timezone specification"
51 string(20) "Unexpected character"
53 string(47) "The timezone could not be found in the database"
55 string(20) "Unexpected character"
57 string(20) "Unexpected character"
59 string(29) "Double timezone specification"
61 string(20) "Unexpected character"
63 string(25) "Double time specification"