|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2019-09-28 14:09 UTC] tandre@php.net
 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 01:00:01 2025 UTC | 
Evaluation is also affected » php --no-php-ini -d short_open_tag=0 -a Interactive shell php > eval('?>FOO<?php'); FOO<?php