Skip to content

Commit 1126337

Browse files
committed
Review updates
1 parent 101cb54 commit 1126337

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

Zend/zend_language_scanner.l

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2758,6 +2758,7 @@ skip_escape_conversion:
27582758
SCNG(heredoc_scan_ahead) = 1;
27592759
SCNG(heredoc_indentation) = 0;
27602760
SCNG(heredoc_indentation_uses_spaces) = 0;
2761+
SCNG(on_event_context);
27612762
LANG_SCNG(on_event) = NULL;
27622763
CG(doc_comment) = NULL;
27632764
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
GH-19507: Corrupted result after recursive tokenization during token_get_all()
2+
GH-19507: Corrupted result after recursive tokenization during token_get_all() (error handler with eval)
33
--EXTENSIONS--
44
tokenizer
55
--FILE--
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
GH-19507: Corrupted result after recursive tokenization during token_get_all() (error handler with throw)
3+
--EXTENSIONS--
4+
tokenizer
5+
--FILE--
6+
<?php
7+
8+
set_error_handler(function (int $errno, string $msg) {
9+
throw new RuntimeException('error handler called: ' . $msg);
10+
});
11+
12+
13+
$tokens = PhpToken::tokenize('<?php (double) $x;', TOKEN_PARSE);
14+
foreach ($tokens as $token) {
15+
echo $token->getTokenName(), "\n";
16+
}
17+
?>
18+
--EXPECTF--
19+
Fatal error: Uncaught RuntimeException: error handler called: Non-canonical cast (double) is deprecated, use the (float) cast instead in %s:%d
20+
Stack trace:
21+
#0 [internal function]: {closure:%s:%d}(%d, 'Non-canonical c...', '', 1)
22+
#1 %s(%d): PhpToken::tokenize('<?php (double) ...', %d)
23+
#2 {main}
24+
thrown in %s on line %d

0 commit comments

Comments
 (0)