xref: /PHP-8.2/ext/tokenizer/tests/bug81342.phpt (revision a4acba9e)
1--TEST--
2Bug #81342: New ampersand token parsing depends on new line after it
3--EXTENSIONS--
4tokenizer
5--FILE--
6<?php
7
8$tokens = PhpToken::tokenize('<?php $x & $x; $x &
9    $baz;
10');
11foreach ($tokens as $token) {
12    echo $token->getTokenName(), "\n";
13}
14
15?>
16--EXPECT--
17T_OPEN_TAG
18T_VARIABLE
19T_WHITESPACE
20T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG
21T_WHITESPACE
22T_VARIABLE
23;
24T_WHITESPACE
25T_VARIABLE
26T_WHITESPACE
27T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG
28T_WHITESPACE
29T_VARIABLE
30;
31T_WHITESPACE
32