mirror of
https://github.com/php/php-src.git
synced 2026-03-26 17:22:15 +01:00
41 lines
627 B
PHP
41 lines
627 B
PHP
--TEST--
|
|
Bug #54089 (token_get_all() does not stop after __halt_compiler)
|
|
--SKIPIF--
|
|
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
|
|
--FILE--
|
|
<?php
|
|
$code = "<?php __halt_compiler();\x01?>\x02";
|
|
$tokens = token_get_all($code);
|
|
|
|
var_dump($tokens);
|
|
|
|
$code = '';
|
|
foreach ($tokens as $t)
|
|
{
|
|
$code .= isset($t[1]) ? $t[1] : $t;
|
|
}
|
|
var_dump($code);
|
|
?>
|
|
--EXPECTF--
|
|
array(2) {
|
|
[0]=>
|
|
array(3) {
|
|
[0]=>
|
|
int(%d)
|
|
[1]=>
|
|
string(6) "<?php "
|
|
[2]=>
|
|
int(1)
|
|
}
|
|
[1]=>
|
|
array(3) {
|
|
[0]=>
|
|
int(%d)
|
|
[1]=>
|
|
string(15) "__halt_compiler"
|
|
[2]=>
|
|
int(1)
|
|
}
|
|
}
|
|
string(21) "<?php __halt_compiler"
|