1--TEST--
2Test token_get_all() function : usage variations - with HTML code
3--EXTENSIONS--
4tokenizer
5--FILE--
6<?php
7/*
8 * Testing token_get_all() with source string containing HTML code with PHP
9 *   HTML tags are considered to be T_INLINE_HTML(311)
10*/
11
12echo "*** Testing token_get_all() : 'source' string with HTML tags ***\n";
13
14$source = '
15<html>
16<body>
17    Testing HTML
18</body>
19</html>"
20
21<?php
22    echo "php code with HTML";
23?>';
24var_dump( token_get_all($source));
25
26echo "Done"
27?>
28--EXPECTF--
29*** Testing token_get_all() : 'source' string with HTML tags ***
30array(9) {
31  [0]=>
32  array(3) {
33    [0]=>
34    int(%d)
35    [1]=>
36    string(50) "
37<html>
38<body>
39    Testing HTML
40</body>
41</html>"
42
43"
44    [2]=>
45    int(1)
46  }
47  [1]=>
48  array(3) {
49    [0]=>
50    int(%d)
51    [1]=>
52    string(6) "<?php
53"
54    [2]=>
55    int(8)
56  }
57  [2]=>
58  array(3) {
59    [0]=>
60    int(%d)
61    [1]=>
62    string(4) "    "
63    [2]=>
64    int(9)
65  }
66  [3]=>
67  array(3) {
68    [0]=>
69    int(%d)
70    [1]=>
71    string(4) "echo"
72    [2]=>
73    int(9)
74  }
75  [4]=>
76  array(3) {
77    [0]=>
78    int(%d)
79    [1]=>
80    string(1) " "
81    [2]=>
82    int(9)
83  }
84  [5]=>
85  array(3) {
86    [0]=>
87    int(%d)
88    [1]=>
89    string(20) ""php code with HTML""
90    [2]=>
91    int(9)
92  }
93  [6]=>
94  string(1) ";"
95  [7]=>
96  array(3) {
97    [0]=>
98    int(%d)
99    [1]=>
100    string(1) "
101"
102    [2]=>
103    int(9)
104  }
105  [8]=>
106  array(3) {
107    [0]=>
108    int(%d)
109    [1]=>
110    string(2) "?>"
111    [2]=>
112    int(10)
113  }
114}
115Done
116