xref: /PHP-8.0/ext/tokenizer/tests/001.phpt (revision 5dafd7b4)
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";
129
130echo "Done\n";
131?>
132--EXPECT--
133T_INCLUDE
134T_INCLUDE_ONCE
135T_EVAL
136T_REQUIRE
137T_REQUIRE_ONCE
138T_LOGICAL_OR
139T_LOGICAL_XOR
140T_LOGICAL_AND
141T_PRINT
142T_PLUS_EQUAL
143T_MINUS_EQUAL
144T_MUL_EQUAL
145T_DIV_EQUAL
146T_CONCAT_EQUAL
147T_MOD_EQUAL
148T_AND_EQUAL
149T_OR_EQUAL
150T_XOR_EQUAL
151T_SL_EQUAL
152T_SR_EQUAL
153T_BOOLEAN_OR
154T_BOOLEAN_AND
155T_IS_EQUAL
156T_IS_NOT_EQUAL
157T_IS_IDENTICAL
158T_IS_NOT_IDENTICAL
159T_IS_SMALLER_OR_EQUAL
160T_IS_GREATER_OR_EQUAL
161T_SL
162T_SR
163T_INC
164T_DEC
165T_INT_CAST
166T_DOUBLE_CAST
167T_STRING_CAST
168T_ARRAY_CAST
169T_OBJECT_CAST
170T_BOOL_CAST
171T_UNSET_CAST
172T_NEW
173T_EXIT
174T_IF
175T_ELSEIF
176T_ELSE
177T_ENDIF
178T_LNUMBER
179T_DNUMBER
180T_STRING
181T_STRING_VARNAME
182T_VARIABLE
183T_NUM_STRING
184T_INLINE_HTML
185T_ENCAPSED_AND_WHITESPACE
186T_CONSTANT_ENCAPSED_STRING
187T_ECHO
188T_DO
189T_WHILE
190T_ENDWHILE
191T_FOR
192T_ENDFOR
193T_FOREACH
194T_ENDFOREACH
195T_DECLARE
196T_ENDDECLARE
197T_AS
198T_SWITCH
199T_ENDSWITCH
200T_CASE
201T_DEFAULT
202T_BREAK
203T_CONTINUE
204T_FUNCTION
205T_CONST
206T_RETURN
207T_USE
208T_GLOBAL
209T_STATIC
210T_VAR
211T_UNSET
212T_ISSET
213T_EMPTY
214T_CLASS
215T_EXTENDS
216T_INTERFACE
217T_IMPLEMENTS
218T_OBJECT_OPERATOR
219T_DOUBLE_ARROW
220T_LIST
221T_ARRAY
222T_CLASS_C
223T_FUNC_C
224T_METHOD_C
225T_LINE
226T_FILE
227T_COMMENT
228T_DOC_COMMENT
229T_OPEN_TAG
230T_OPEN_TAG_WITH_ECHO
231T_CLOSE_TAG
232T_WHITESPACE
233T_START_HEREDOC
234T_END_HEREDOC
235T_DOLLAR_OPEN_CURLY_BRACES
236T_CURLY_OPEN
237T_DOUBLE_COLON
238T_DOUBLE_COLON
239T_ABSTRACT
240T_CATCH
241T_FINAL
242T_INSTANCEOF
243T_PRIVATE
244T_PROTECTED
245T_PUBLIC
246T_THROW
247T_TRY
248T_CLONE
249T_HALT_COMPILER
250UNKNOWN
251UNKNOWN
252Done
253