Annotation of embedaddon/php/ext/tokenizer/tests/bug54089.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #54089 (token_get_all() does not stop after __halt_compiler)
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("tokenizer")) print "skip"; ?>
! 5: --FILE--
! 6: <?php
! 7: $code = "<?php __halt_compiler();\x01?>\x02";
! 8: $tokens = token_get_all($code);
! 9:
! 10: var_dump($tokens);
! 11:
! 12: $code = '';
! 13: foreach ($tokens as $t)
! 14: {
! 15: $code .= isset($t[1]) ? $t[1] : $t;
! 16: }
! 17: var_dump($code);
! 18: ?>
! 19: --EXPECTF--
! 20: array(2) {
! 21: [0]=>
! 22: array(3) {
! 23: [0]=>
! 24: int(%d)
! 25: [1]=>
! 26: string(6) "<?php "
! 27: [2]=>
! 28: int(1)
! 29: }
! 30: [1]=>
! 31: array(3) {
! 32: [0]=>
! 33: int(%d)
! 34: [1]=>
! 35: string(15) "__halt_compiler"
! 36: [2]=>
! 37: int(1)
! 38: }
! 39: }
! 40: string(21) "<?php __halt_compiler"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>