From: tandre
Operating system:
PHP version: 7.4.0RC2
Package: Testing related
Bug Type: Bug
Bug description:token_get_all() does not properly tokenize FOO<?php with
short_open_tag=0
Description:
------------
Note that this happened for me when php was configured with short tags,
both for the latest php 7.4 and 8.0 (e.g. this is what travis/compile.sh
would do)
ext/tokenizer/tests/php_tag_only.phpt would fail if php.ini had
short_open_tags=0
tested with php 7.4 NTS, ZTS, and php 8.0 NTS (compiled within the last
month)
Test script:
---------------
» php --no-php-ini -d short_open_tag=0 -a
Interactive shell
php > var_export(token_get_all('FOO<?php'));
array (
0 =>
array (
0 => 313,
1 => 'FOO<?php',
2 => 1,
),
)
php > echo PHP_VERSION;
7.4.0-dev
Expected result:
----------------
Outputs two tokens, one for FOO, and one for <?php
Actual result:
--------------
Outputs a single token with FOO<?php
--
Edit bug report at https://bugs.php.net/bug.php?id=78604&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=78604&r=fixed
Fixed in release:
https://bugs.php.net/fix.php?id=78604&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=78604&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=78604&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=78604&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=78604&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=78604&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=78604&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=78604&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=78604&r=globals
PHP version support discontinued:
https://bugs.php.net/fix.php?id=78604&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=78604&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78604&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78604&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78604&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78604&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=78604&r=mysqlcfg