2 Test mktime() function : error conditions
5 /* Prototype : int mktime ([ int $hour= date("H") [, int $minute= date("i") [, int $second= date("s") [, int $month= date("n") [, int $day= date("j") [, int $year= date("Y") [, int $is_dst= -1 ]]]]]]] )
6 * Description: Get Unix timestamp for a date
7 * Source code: ext/date/php_date.c
11 //Set the default time zone
12 date_default_timezone_set("Europe/London");
14 echo "*** Testing mktime() : error conditions ***\n";
16 echo "\n-- Testing mktime() function with Zero arguments --\n";
19 } catch (TypeError $e) {
20 echo $e->getMessage(), "\n";
23 echo "\n-- Testing mktime() function with more than expected no. of arguments --\n";
32 var_dump( mktime($hour, $minute, $sec, $month, $day, $year, $extra_arg) );
33 } catch (TypeError $e) {
34 echo $e->getMessage(), "\n";
39 *** Testing mktime() : error conditions ***
41 -- Testing mktime() function with Zero arguments --
42 mktime() expects at least 1 parameter, 0 given
44 -- Testing mktime() function with more than expected no. of arguments --
45 mktime() expects at most 6 parameters, 7 given