We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 089b020 commit 272b4b6Copy full SHA for 272b4b6
ext/tokenizer/tests/bug19507.phpt
@@ -0,0 +1,27 @@
1
+--TEST--
2
+Bug #19507: Recursive tokenization during `token_get_all` result on error
3
+--EXTENSIONS--
4
+tokenizer
5
+--FILE--
6
+<?php
7
+
8
+set_error_handler(function (int $errno, string $msg) {
9
+ eval('123 + 2;');
10
+ echo 'error handler called: ', $msg, "\n";
11
+});
12
13
14
+$tokens = PhpToken::tokenize('<?php (double) $x;', TOKEN_PARSE);
15
+foreach ($tokens as $token) {
16
+ echo $token->getTokenName(), "\n";
17
+}
18
19
+--EXPECT--
20
+error handler called: Non-canonical cast (double) is deprecated, use the (float) cast instead
21
+T_OPEN_TAG
22
+T_LNUMBER
23
+;
24
+T_DOUBLE_CAST
25
+T_WHITESPACE
26
+T_VARIABLE
27
0 commit comments