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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: joelm at fb dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 13 13:01:27 2024 UTC