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