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