Annotation of embedaddon/php/ext/date/tests/localtime_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test localtime() function : error conditions
3: --FILE--
4: <?php
5: /* Prototype : array localtime([int timestamp [, bool associative_array]])
6: * Description: Returns the results of the C system call localtime as an associative array
7: * if the associative_array argument is set to 1 other wise it is a regular array
8: * Source code: ext/date/php_date.c
9: * Alias to functions:
10: */
11:
12: //Set the default time zone
13: date_default_timezone_set("Europe/London");
14:
15: echo "*** Testing localtime() : error conditions ***\n";
16:
17: echo "\n-- Testing localtime() function with more than expected no. of arguments --\n";
18: $timestamp = gmmktime(8, 8, 8, 8, 8, 2008);
19: $assoc = true;
20: $extra_arg = 10;
21: var_dump( localtime($timestamp, $assoc, $extra_arg) );
22:
23: ?>
24: ===DONE===
25: --EXPECTF--
26: *** Testing localtime() : error conditions ***
27:
28: -- Testing localtime() function with more than expected no. of arguments --
29:
30: Warning: localtime() expects at most 2 parameters, 3 given in %s on line %d
31: bool(false)
32: ===DONE===
33:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>