xref: /PHP-5.4/ext/date/tests/mktime_basic1.phpt (revision a2e47734)
1--TEST--
2Test mktime() function : basic functionality
3--FILE--
4<?php
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
8 * Alias to functions:
9 */
10error_reporting(E_ALL | E_STRICT);
11
12//Set the default time zone
13date_default_timezone_set("Europe/London");
14
15echo "*** Testing DateTime::modify() : basic functionality ***\n";
16
17$hour = 10;
18$minute = 30;
19$sec = 45;
20$month = 7;
21$day = 2;
22$year = 1963;
23$is_dst = 0;
24
25var_dump( mktime($hour) );
26var_dump( mktime($hour, $minute) );
27var_dump( mktime($hour, $minute, $sec) );
28var_dump( mktime($hour, $minute, $sec, $month) );
29var_dump( mktime($hour, $minute, $sec, $month, $day) );
30var_dump( mktime($hour, $minute, $sec, $month, $day, $year) );
31var_dump( mktime($hour, $minute, $sec, $month, $day, $year, $is_dst) );
32
33?>
34===DONE===
35--EXPECTF--
36*** Testing DateTime::modify() : basic functionality ***
37int(%i)
38int(%i)
39int(%i)
40int(%i)
41int(%i)
42int(%i)
43
44Deprecated: mktime(): The is_dst parameter is deprecated in %s on line %d
45int(%i)
46===DONE===
47
48