xref: /PHP-7.3/ext/tokenizer/tests/003.phpt (revision 782352c5)
1--TEST--
2token_get_all() and wrong parameters
3--SKIPIF--
4<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
5--FILE--
6<?php
7
8var_dump(token_get_all(array()));
9var_dump(token_get_all(new stdClass));
10var_dump(token_get_all(""));
11var_dump(token_get_all(0));
12var_dump(token_get_all(-1));
13
14echo "Done\n";
15?>
16--EXPECTF--
17Warning: token_get_all() expects parameter 1 to be string, array given in %s on line %d
18NULL
19
20Warning: token_get_all() expects parameter 1 to be string, object given in %s on line %d
21NULL
22array(0) {
23}
24array(1) {
25  [0]=>
26  array(3) {
27    [0]=>
28    int(%d)
29    [1]=>
30    string(1) "0"
31    [2]=>
32    int(1)
33  }
34}
35array(1) {
36  [0]=>
37  array(3) {
38    [0]=>
39    int(%d)
40    [1]=>
41    string(2) "-1"
42    [2]=>
43    int(1)
44  }
45}
46Done
47