validate: include decls in the multiple validation rounds
[m6w6/ext-psi] / tests / time / gettimeofday001.phpt
1 --TEST--
2 gettimeofday
3 --INI--
4 psi.directory = {PWD}/../../psi.d:{PWD}
5 --SKIPIF--
6 <?php
7 extension_loaded("psi") or die("skip - need ext/psi");
8 ?>
9 --ENV--
10 TZ=UTC
11 --FILE--
12 ===TEST===
13 <?php
14
15 var_dump($ar = gettimeofday());
16
17 var_dump(psi\gettimeofday());
18 var_dump(psi\gettimeofday($tv), $tv);
19 var_dump(psi\gettimeofday($tv, $tz), $tv, $tz);
20
21 var_dump(abs($ar["sec"] - $tv["tv_sec"]) <= 1);
22
23 ?>
24 ===DONE===
25 --EXPECTF--
26 ===TEST===
27 array(4) {
28 ["sec"]=>
29 int(1%d)
30 ["usec"]=>
31 int(%d)
32 ["minuteswest"]=>
33 int(%i)
34 ["dsttime"]=>
35 int(%i)
36 }
37 int(0)
38 int(0)
39 array(2) {
40 ["tv_sec"]=>
41 int(1%d)
42 ["tv_usec"]=>
43 int(%d)
44 }
45 int(0)
46 array(2) {
47 ["tv_sec"]=>
48 int(1%d)
49 ["tv_usec"]=>
50 int(%d)
51 }
52 array(2) {
53 ["tz_minuteswest"]=>
54 int(%i)
55 ["tz_dsttime"]=>
56 int(%i)
57 }
58 bool(true)
59 ===DONE===