|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73420 unsemicoloned expressions vs statements
Submitted: 2016-10-30 13:31 UTC Modified: 2020-03-15 22:32 UTC
From: ewan dot delanoy at gmx dot fr Assigned:
Status: Verified Package: PHP Language Specification
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-10-30 13:31 UTC] ewan dot delanoy at gmx dot fr
    Consider the following (valid) one-line php code :

<input type="<?php echo 'text' ?>"/>

   According to, in the code above echo 'text' must be a statement-list.
   According to, this statement-list must in fact consist of a single statement.

  But what type of statement is it ? If we look at the enumeration at, it seems to be an expression-statement. But says that expression-statements always end with a semicolon.


Test script:
<input type="<?php echo 'text' ?>"/>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-03-15 22:32 UTC]
-Status: Open +Status: Verified -Type: Documentation Problem +Type: Bug
 [2020-03-15 22:32 UTC]
> […] it seems to be an expression-statement.

Well, looks more like an echo-statement, but that's not really the
point anyway.  The relevant omission from the language
specification is that a semicolon is automatically inserted before
an PHP end tag[1].  To let that be valid syntax, an
empty-statement would also have to be defined (and is needed

[1] <>
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 15:01:28 2024 UTC