php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63794 Parser does not match EOF after opening tag
Submitted: 2012-12-18 00:47 UTC Modified: 2012-12-18 03:40 UTC
From: simon at simon dot geek dot nz Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.5.0alpha1 OS: N/A
Private report: No CVE-ID: None
 [2012-12-18 00:47 UTC] simon at simon dot geek dot nz
Description:
------------
The parser for the opening tag checks for <?php[ \t\n]. This causes a file that's 
an opening tag, directly followed by the EOF to not be parsed as a PHP file, 
causing the tag to be outputted.

Test script:
---------------
<?php

Expected result:
----------------
No output at all.

Actual result:
--------------
The <?php tag is outputted.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-18 00:49 UTC] simon at simon dot geek dot nz
Tested this on PHP 5.3.15, 5.4.9-dev and 5.5.0a1. The same behaviour occurs each 
time.
 [2012-12-18 02:44 UTC] laruence@php.net
I am not sure, why we need this?
 [2012-12-18 02:50 UTC] aharvey@php.net
Rasmus's comment in bug #61723 is probably relevant here.
 [2012-12-18 03:40 UTC] rasmus@php.net
-Status: Open +Status: Not a bug
 [2012-12-18 03:40 UTC] rasmus@php.net
Yeah, EOF is not classified as whitespace as per the spec, so <?php<EOF> is not 
actually a valid opening PI tag and as such it is correct that it will be output. 
No bug here.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 19:01:33 2024 UTC