]> granicus.if.org Git - php/blob
d7eb11fc55
[php] /
1 --TEST--
2 Test localtime() function : error conditions
3 --SKIPIF--
4 <?php
5 if (!function_exists('strptime')) {
6         echo "SKIP strptime function not available in build";
7 }
8 ?>
9 --FILE--
10 <?php
11 /* Prototype  : array strptime  ( string $date  , string $format  )
12  * Description: Parse a time/date generated with strftime()
13  * Source code: ext/standard/datetime.c
14  * Alias to functions:
15  */
16
17 //Set the default time zone
18 date_default_timezone_set("Europe/London");
19
20 echo "*** Testing strptime() : error conditions ***\n";
21
22 echo "\n-- Testing strptime() function on failure --\n";
23 $format = '%b %d %Y %H:%M:%S';
24 var_dump( strptime('foo', $format) );
25
26 ?>
27 --EXPECTF--
28 *** Testing strptime() : error conditions ***
29
30 -- Testing strptime() function on failure --
31 bool(false)