Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are PHP's ASP and script tags removed

Tags:

php

I'm working on PHP 5.3. However while looking at PHP manual, I find only Standard tags and short tags are documented in latest manual. Script and ASP tags are not documented. I understand they are not recommended and I do not use them. Just asking for info.

In latest manual, there is no thing about asp tags and script tags. So I believe they are removed in latest version of PHP but could not verify. I tried to look at change log but could not find if they are removed and if yes, when.

Can someone please answer if they are still supported (even though depreciated) in latest version of PHP? If no, in which version they were depreciated and when they were completely removed?

like image 337
Kapil Sharma Avatar asked Mar 08 '14 09:03

Kapil Sharma


People also ask

Should I use PHP short tags?

Using short tags should be avoided when developing applications or libraries that are meant for redistribution, or deployment on PHP servers which are not under your control, because short tags may not be supported on the target server. For portable, redistributable code, be sure not to use short tags.

What is short open tag in PHP?

The <= tag is called short open tag in PHP. To use the short tags, one must have to enable it from settings in the PHP. ini file.

Between which tags is PHP code written?

php and ?>. These are called PHP's opening and closing tags. Statements witihn these two are interpreted by the parser. PHP script within these tags can be embedded in HTML document, so that embedded code is executed on server, leaving rest of the document to be processed by client browser's HTML parser.

How do I end a PHP script?

The closing tag of a block of PHP code automatically implies a semicolon; you do not need to have a semicolon terminating the last line of a PHP block. The closing tag for the block will include the immediately trailing newline if one is present. <?


1 Answers

OMG , I did not even knew before that ASP tags can be used..

Anyhow, I do not know which version of the manual you are looking at , but Look here :

http://us1.php.net/manual/en/ini.core.php#ini.asp-tags

For shorthand tags it say :

Note: This directive also affected the shorthand <? echo. Use of this shortcut required short_open_tag to be on. Since PHP 5.4.0, <?= is always available.

for Script and ASP : (Example two is script)

http://us1.php.net/manual/en/language.basic-syntax.phpmode.php

While the tags seen in examples one and two are both always available, example one is the most commonly used, and recommended, of the two.

Short tags (example three) are only available when they are enabled via the short_open_tag php.ini configuration file directive, or if PHP was configured with the --enable-short-tags option.

ASP style tags (example four) are only available when they are enabled via the asp_tags php.ini configuration file directive.

So in essence if the Document is correct, and updated - , they are not yet deprecated.

Further info here : Are PHP short tags acceptable to use?

[DUPLICATE ?]

like image 89
Obmerk Kronen Avatar answered Oct 16 '22 21:10

Obmerk Kronen