1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/tokenizer/tests/bug76437.phpt
Nikita Popov 7485978339 Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00

27 lines
634 B
PHP

--TEST--
Bug #76437 (token_get_all with TOKEN_PARSE flag fails to recognise close tag)
--EXTENSIONS--
tokenizer
--FILE--
<?php
$tests = [
['<?=$a?>', 0],
['<?php echo 2; ?>', 6],
["<?php echo 2; ?>\n", 6],
];
foreach ($tests as [$code, $index]) {
$open_tag1 = token_get_all($code)[$index];
$open_tag2 = token_get_all($code, TOKEN_PARSE)[$index];
echo token_name($open_tag1[0]), ": \"$open_tag1[1]\" on line $open_tag1[2]\n";
var_dump($open_tag1 === $open_tag2);
}
?>
--EXPECT--
T_OPEN_TAG_WITH_ECHO: "<?=" on line 1
bool(true)
T_CLOSE_TAG: "?>" on line 1
bool(true)
T_CLOSE_TAG: "?>
" on line 1
bool(true)