php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #78144 Is <?= shorthand tag removed in 7.0.0 or not?
Submitted: 2019-06-11 13:10 UTC Modified: 2019-06-11 15:45 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: johannes dot kingma at gmail dot com Assigned:
Status: Not a bug Package: PHP Language Specification
PHP Version: 7.0.0 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: johannes dot kingma at gmail dot com
New email:
PHP Version: OS:

 

 [2019-06-11 13:10 UTC] johannes dot kingma at gmail dot com
Description:
------------
---
From manual page: https://php.net/language.basic-syntax.phptags
---

In https://www.php.net/manual/en/ini.core.php#ini.short-open-tag one can read that from 5.4 <?= will always be available  and that asp_tags will be removed.

Basic syntax in Changelog claims that <?= were removed from 7.0.0

What is true?

Test script:
---------------
Text should read:
7.0.0	The ASP tags <%, %> and the script tag <script language="php"> are removed from PHP. The shorthand tag <?= will be available.

Expected result:
----------------
In the php_ini-production:
; This directive determines whether or not PHP will recognize code between
; <? and ?> tags as PHP source which should be processed as such. It is
; generally recommended that <?php and ?> should be used and that this feature
; should be disabled, as enabling it may result in issues when generating XML
; documents, however this remains supported for backward compatibility reasons.
; Note that this directive does not control the <?= shorthand tag, which can be
; used regardless of this directive.
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/short-open-tag
short_open_tag = Off


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-06-11 13:18 UTC] peehaa@php.net
-Status: Open +Status: Feedback
 [2019-06-11 13:18 UTC] peehaa@php.net
Do you have a link for that? I only see:

> The ASP tags <%, %>, <%=, and the script tag <script language="php"> are removed from PHP. 

@ https://www.php.net/manual/en/language.basic-syntax.phptags.php
 [2019-06-11 13:37 UTC] johannes dot kingma at gmail dot com
A link? How do you mean?

In the php.ini-production von php7.3 I see:


; This directive determines whether or not PHP will recognize code between
; <? and ?> tags as PHP source which should be processed as such. It is
; generally recommended that <?php and ?> should be used and that this feature
; should be disabled, as enabling it may result in issues when generating XML
; documents, however this remains supported for backward compatibility reasons.
; Note that this directive does not control the <?= shorthand tag, which can be
; used regardless of this directive.
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/short-open-tag
short_open_tag = Off
 [2019-06-11 13:44 UTC] peehaa@php.net
What is the confusion? It is saying the same thing everywhere.
 [2019-06-11 14:23 UTC] girgias@php.net
-Summary: Removed in 7.0.0 or not? +Summary: Is <?= shorthand tag removed in 7.0.0 or not? -Operating System: <?= shorthand tag +Operating System: -PHP Version: 7.3.6 +PHP Version: 7.0.0
 [2019-06-11 14:23 UTC] girgias@php.net
The changelog entry is on the ASP tags [1] which have been removed.

The short echo tag <?= is always available as of PHP 5.4 as can be seen on the note above [1]

It seems you are not making a distinction between both INI directives

[1] https://www.php.net/manual/en/ini.core.php#ini.asp-tags
 [2019-06-11 14:45 UTC] johannes dot kingma at gmail dot com
ON https://www.php.net/manual/en/language.basic-syntax.phptags.php
under Chantelog I read:

7.0.0	The ASP tags <%, %>, <%=, and the script tag <script language="php"> are removed from PHP.

The ASP tags ARE, the short code <?= is NOT removed from PHP in version 7.+
 [2019-06-11 14:51 UTC] peehaa@php.net
> <?= is NOT removed from PHP in version 7.+

You are correct that they are not removed. You are incorrect in your assumption that it is stated otherwise (on any of your shared links).
 [2019-06-11 15:05 UTC] johannes dot kingma at gmail dot com
-Status: Feedback +Status: Open
 [2019-06-11 15:05 UTC] johannes dot kingma at gmail dot com
https://www.php.net/manual/en/language.basic-syntax.phptags.php

https://imgur.com/a/C7dkpm9
 [2019-06-11 15:08 UTC] johannes dot kingma at gmail dot com
Btw this Changelog is wrong in all languages except Chinese.
 [2019-06-11 15:16 UTC] peehaa@php.net
-Status: Open +Status: Not a bug
 [2019-06-11 15:16 UTC] peehaa@php.net
No it is not. You are confusing an ASP tag (<%=) with a PHp tag (<?=).

They are different things.
 [2019-06-11 15:24 UTC] johannes dot kingma at gmail dot com
You're absolutely right and I am blind and offer my sincere apologies


In my defence: the whole text is confusing for the reader. why write about ASP tags in a document about standard and short PHP tags? It is not mentionened in the document. 

This might make sense from a historic point of view but has no use in document on PHP tags.
 [2019-06-11 15:45 UTC] girgias@php.net
Because the documentation covers every version of PHP from PHP 5.0.0.

And in PHP 5, ASP tags where valid PHP tags.

Moreover, I don't see how the text is confusing what so ever, but maybe that's just me.
 [2019-06-11 21:08 UTC] johannes dot kingma at gmail dot com
I might be me but the document lacks definition of ASP tags.

It should mention or explain that ASP tags <% %> <%= and explain that they are gone on 5.4.+ or should not be mentioned at all. Or, alternative should be describted in a document called ASP tags. 

Out of the blue they appear in the Changelog without being described or used anywhere else. This IS confusing. If the goal of php.net is to explain things than it should explain things it mentions or not mention them. Do I make sense here? Am I the only one being thrown of gard by a sudden reference to ASP tags in the Changelog?

I means searching for ASP Tags gets a "asp tags doesn't exist" so I assume they don't.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Sep 20 03:03:36 2021 UTC