blob: f84190cb3d9f84bd69197ec35ae31cb2c953b51c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
--TEST--
Test wrong number of arguments for microtime()
--FILE--
<?php
/*
* proto mixed microtime([bool get_as_float])
* Function is implemented in ext/standard/microtime.c
*/
$opt_arg_0 = true;
$extra_arg = 1;
echo "\n-- Too many arguments --\n";
var_dump(microtime($opt_arg_0, $extra_arg));
echo "\n-- Bad Arg types --\n";
$bad_args = array(null,
1.5,
"hello",
array('k'=>'v', array(0)),
new stdClass,
1);
foreach ($bad_args as $bad_arg) {
echo "\n--> bad arg: ";
var_dump($bad_arg);
var_dump(microtime($bad_arg));
}
?>
===DONE===
--EXPECTF--
-- Too many arguments --
Warning: microtime() expects at most 1 parameter, 2 given in %s on line 11
NULL
-- Bad Arg types --
--> bad arg: NULL
string(%d) "%s %s"
--> bad arg: float(1.5)
float(%s)
--> bad arg: string(5) "hello"
float(%s)
--> bad arg: array(2) {
["k"]=>
string(1) "v"
[0]=>
array(1) {
[0]=>
int(0)
}
}
Warning: microtime() expects parameter 1 to be boolean, array given in %s on line 25
NULL
--> bad arg: object(stdClass)#%d (0) {
}
Warning: microtime() expects parameter 1 to be boolean, object given in %s on line 25
NULL
--> bad arg: int(1)
float(%s)
===DONE===
|