php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67766 Inaccuracies in Program Structure
Submitted: 2014-08-05 16:15 UTC Modified: 2015-06-28 20:59 UTC
From: joelm at fb dot com Assigned: stas (profile)
Status: Closed Package: PHP Language Specification
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2014-08-05 16:15 UTC] joelm at fb dot com
Description:
------------
https://github.com/php/php-langspec/blob/master/spec/04-basic-concepts.md#program-structure

The "<?php" open tag doesn't have to be at the top of the file, it can come later, and technically a PHP file might not have any tags at all. Also, after the "?>" close tag there can be more stuff and possible another open tag "<?php". Finally, there are some interesting things like how "<?" (with the "php" part) work as an open tag, and how "<script language='php'>" can also work as an open tag. Stuff that appears before the first open tag and stuff that appears after a close tag but before the next open tag is treated as content that is echo'd out when the flow of execution reaches it. 

Some of this has been addressed by changing the grammar for the syntactic grammar production “program”.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-08-05 16:30 UTC] joelm@php.net
-Type: Documentation Problem +Type: Bug
 [2015-06-28 20:59 UTC] stas@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: stas
 [2015-06-28 20:59 UTC] stas@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

This seems to be already fixed.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Nov 23 20:01:23 2020 UTC