xref: /PHP-7.0/ext/tokenizer/tests/001.phpt (revision e5eb9530)
1--TEST--
2token_name()
3--SKIPIF--
4<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64-bit only");
5if (!extension_loaded("tokenizer")) print "skip"; ?>
6--FILE--
7<?php
8
9echo token_name(T_INCLUDE), "\n";
10echo token_name(T_INCLUDE_ONCE), "\n";
11echo token_name(T_EVAL), "\n";
12echo token_name(T_REQUIRE), "\n";
13echo token_name(T_REQUIRE_ONCE), "\n";
14echo token_name(T_LOGICAL_OR), "\n";
15echo token_name(T_LOGICAL_XOR), "\n";
16echo token_name(T_LOGICAL_AND), "\n";
17echo token_name(T_PRINT), "\n";
18echo token_name(T_PLUS_EQUAL), "\n";
19echo token_name(T_MINUS_EQUAL), "\n";
20echo token_name(T_MUL_EQUAL), "\n";
21echo token_name(T_DIV_EQUAL), "\n";
22echo token_name(T_CONCAT_EQUAL), "\n";
23echo token_name(T_MOD_EQUAL), "\n";
24echo token_name(T_AND_EQUAL), "\n";
25echo token_name(T_OR_EQUAL), "\n";
26echo token_name(T_XOR_EQUAL), "\n";
27echo token_name(T_SL_EQUAL), "\n";
28echo token_name(T_SR_EQUAL), "\n";
29echo token_name(T_BOOLEAN_OR), "\n";
30echo token_name(T_BOOLEAN_AND), "\n";
31echo token_name(T_IS_EQUAL), "\n";
32echo token_name(T_IS_NOT_EQUAL), "\n";
33echo token_name(T_IS_IDENTICAL), "\n";
34echo token_name(T_IS_NOT_IDENTICAL), "\n";
35echo token_name(T_IS_SMALLER_OR_EQUAL), "\n";
36echo token_name(T_IS_GREATER_OR_EQUAL), "\n";
37echo token_name(T_SL), "\n";
38echo token_name(T_SR), "\n";
39echo token_name(T_INC), "\n";
40echo token_name(T_DEC), "\n";
41echo token_name(T_INT_CAST), "\n";
42echo token_name(T_DOUBLE_CAST), "\n";
43echo token_name(T_STRING_CAST), "\n";
44echo token_name(T_ARRAY_CAST), "\n";
45echo token_name(T_OBJECT_CAST), "\n";
46echo token_name(T_BOOL_CAST), "\n";
47echo token_name(T_UNSET_CAST), "\n";
48echo token_name(T_NEW), "\n";
49echo token_name(T_EXIT), "\n";
50echo token_name(T_IF), "\n";
51echo token_name(T_ELSEIF), "\n";
52echo token_name(T_ELSE), "\n";
53echo token_name(T_ENDIF), "\n";
54echo token_name(T_LNUMBER), "\n";
55echo token_name(T_DNUMBER), "\n";
56echo token_name(T_STRING), "\n";
57echo token_name(T_STRING_VARNAME), "\n";
58echo token_name(T_VARIABLE), "\n";
59echo token_name(T_NUM_STRING), "\n";
60echo token_name(T_INLINE_HTML), "\n";
61echo token_name(T_ENCAPSED_AND_WHITESPACE), "\n";
62echo token_name(T_CONSTANT_ENCAPSED_STRING), "\n";
63echo token_name(T_ECHO), "\n";
64echo token_name(T_DO), "\n";
65echo token_name(T_WHILE), "\n";
66echo token_name(T_ENDWHILE), "\n";
67echo token_name(T_FOR), "\n";
68echo token_name(T_ENDFOR), "\n";
69echo token_name(T_FOREACH), "\n";
70echo token_name(T_ENDFOREACH), "\n";
71echo token_name(T_DECLARE), "\n";
72echo token_name(T_ENDDECLARE), "\n";
73echo token_name(T_AS), "\n";
74echo token_name(T_SWITCH), "\n";
75echo token_name(T_ENDSWITCH), "\n";
76echo token_name(T_CASE), "\n";
77echo token_name(T_DEFAULT), "\n";
78echo token_name(T_BREAK), "\n";
79echo token_name(T_CONTINUE), "\n";
80echo token_name(T_FUNCTION), "\n";
81echo token_name(T_CONST), "\n";
82echo token_name(T_RETURN), "\n";
83echo token_name(T_USE), "\n";
84echo token_name(T_GLOBAL), "\n";
85echo token_name(T_STATIC), "\n";
86echo token_name(T_VAR), "\n";
87echo token_name(T_UNSET), "\n";
88echo token_name(T_ISSET), "\n";
89echo token_name(T_EMPTY), "\n";
90echo token_name(T_CLASS), "\n";
91echo token_name(T_EXTENDS), "\n";
92echo token_name(T_INTERFACE), "\n";
93echo token_name(T_IMPLEMENTS), "\n";
94echo token_name(T_OBJECT_OPERATOR), "\n";
95echo token_name(T_DOUBLE_ARROW), "\n";
96echo token_name(T_LIST), "\n";
97echo token_name(T_ARRAY), "\n";
98echo token_name(T_CLASS_C), "\n";
99echo token_name(T_FUNC_C), "\n";
100echo token_name(T_METHOD_C), "\n";
101echo token_name(T_LINE), "\n";
102echo token_name(T_FILE), "\n";
103echo token_name(T_COMMENT), "\n";
104echo token_name(T_DOC_COMMENT), "\n";
105echo token_name(T_OPEN_TAG), "\n";
106echo token_name(T_OPEN_TAG_WITH_ECHO), "\n";
107echo token_name(T_CLOSE_TAG), "\n";
108echo token_name(T_WHITESPACE), "\n";
109echo token_name(T_START_HEREDOC), "\n";
110echo token_name(T_END_HEREDOC), "\n";
111echo token_name(T_DOLLAR_OPEN_CURLY_BRACES), "\n";
112echo token_name(T_CURLY_OPEN), "\n";
113echo token_name(T_PAAMAYIM_NEKUDOTAYIM), "\n";
114echo token_name(T_PAAMAYIM_NEKUDOTAYIM), "\n";
115echo token_name(T_ABSTRACT), "\n";
116echo token_name(T_CATCH), "\n";
117echo token_name(T_FINAL), "\n";
118echo token_name(T_INSTANCEOF), "\n";
119echo token_name(T_PRIVATE), "\n";
120echo token_name(T_PROTECTED), "\n";
121echo token_name(T_PUBLIC), "\n";
122echo token_name(T_THROW), "\n";
123echo token_name(T_TRY), "\n";
124echo token_name(T_CLONE), "\n";
125echo token_name(T_HALT_COMPILER), "\n";
126
127echo token_name(-1), "\n";
128echo token_name(0x8000000F), "\n";
129echo token_name("string"), "\n";
130echo token_name(array()), "\n";
131
132echo "Done\n";
133?>
134--EXPECTF--
135T_INCLUDE
136T_INCLUDE_ONCE
137T_EVAL
138T_REQUIRE
139T_REQUIRE_ONCE
140T_LOGICAL_OR
141T_LOGICAL_XOR
142T_LOGICAL_AND
143T_PRINT
144T_PLUS_EQUAL
145T_MINUS_EQUAL
146T_MUL_EQUAL
147T_DIV_EQUAL
148T_CONCAT_EQUAL
149T_MOD_EQUAL
150T_AND_EQUAL
151T_OR_EQUAL
152T_XOR_EQUAL
153T_SL_EQUAL
154T_SR_EQUAL
155T_BOOLEAN_OR
156T_BOOLEAN_AND
157T_IS_EQUAL
158T_IS_NOT_EQUAL
159T_IS_IDENTICAL
160T_IS_NOT_IDENTICAL
161T_IS_SMALLER_OR_EQUAL
162T_IS_GREATER_OR_EQUAL
163T_SL
164T_SR
165T_INC
166T_DEC
167T_INT_CAST
168T_DOUBLE_CAST
169T_STRING_CAST
170T_ARRAY_CAST
171T_OBJECT_CAST
172T_BOOL_CAST
173T_UNSET_CAST
174T_NEW
175T_EXIT
176T_IF
177T_ELSEIF
178T_ELSE
179T_ENDIF
180T_LNUMBER
181T_DNUMBER
182T_STRING
183T_STRING_VARNAME
184T_VARIABLE
185T_NUM_STRING
186T_INLINE_HTML
187T_ENCAPSED_AND_WHITESPACE
188T_CONSTANT_ENCAPSED_STRING
189T_ECHO
190T_DO
191T_WHILE
192T_ENDWHILE
193T_FOR
194T_ENDFOR
195T_FOREACH
196T_ENDFOREACH
197T_DECLARE
198T_ENDDECLARE
199T_AS
200T_SWITCH
201T_ENDSWITCH
202T_CASE
203T_DEFAULT
204T_BREAK
205T_CONTINUE
206T_FUNCTION
207T_CONST
208T_RETURN
209T_USE
210T_GLOBAL
211T_STATIC
212T_VAR
213T_UNSET
214T_ISSET
215T_EMPTY
216T_CLASS
217T_EXTENDS
218T_INTERFACE
219T_IMPLEMENTS
220T_OBJECT_OPERATOR
221T_DOUBLE_ARROW
222T_LIST
223T_ARRAY
224T_CLASS_C
225T_FUNC_C
226T_METHOD_C
227T_LINE
228T_FILE
229T_COMMENT
230T_DOC_COMMENT
231T_OPEN_TAG
232T_OPEN_TAG_WITH_ECHO
233T_CLOSE_TAG
234T_WHITESPACE
235T_START_HEREDOC
236T_END_HEREDOC
237T_DOLLAR_OPEN_CURLY_BRACES
238T_CURLY_OPEN
239T_DOUBLE_COLON
240T_DOUBLE_COLON
241T_ABSTRACT
242T_CATCH
243T_FINAL
244T_INSTANCEOF
245T_PRIVATE
246T_PROTECTED
247T_PUBLIC
248T_THROW
249T_TRY
250T_CLONE
251T_HALT_COMPILER
252UNKNOWN
253UNKNOWN
254
255Warning: token_name() expects parameter 1 to be integer, string given in %s on line %d
256
257
258Warning: token_name() expects parameter 1 to be integer, array given in %s on line %d
259
260Done
261