Bug #16066 Updated: <?PHP tag warning!
| From: | yohgaki@php.net | Date: | Fri, 15 Mar 2002 11:59:02 +0000 |
| Subject: | Bug #16066 Updated: <?PHP tag warning! | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-2568@lists.php.net to get a copy of this message | ||
ID: 16066
Updated by: yohgaki@php.net
Reported By: dave@netready.biz
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Linux (Debian)
PHP Version: 4.1.1
New Comment:
PHP will not raise error since it's not PHP script.
There is no way to raise error, if it's not a PHP script.
Previous Comments:
------------------------------------------------------------------------
[2002-03-15 05:27:51] dave@netready.biz
You say you must have a space after <?PHP, <? and <%.
Then the bug is with the error reporting because:
<?/*Hello*/
print "Hello";
?>
does not report an error, either way something is wrong here, because
the behaviour is not consistant for all three of those tokens.
I have looked at "Chapter 5. Basic syntax" section of the manual, this
explains the use of the <?PHP, <? and <%... it does not say anything
about requiring a space. Could this BUG be anything to do with the
fact that you can do "<?=" and "<%=" but not "<?PHP=" ...
which seems a
little strange seeing as <?PHP is supposed to be the "propper" token.
------------------------------------------------------------------------
[2002-03-14 21:04:32] yohgaki@php.net
<?php, <?, <% is token that must be separated by spaces. (You need
space after them) Therefore, this is not a bug .
------------------------------------------------------------------------
[2002-03-14 09:29:53] dave@netready.biz
There is an error with the parsing of the PHP start tag "<?PHP"...
Turn on all error reporting...
error_reporting( E_ALL );
This works ok
<?PHP /*Hello*/?>
However without the space it outputs a warning:
"Warning: Use of undefined constant PHP - assumed 'PHP'"
<?PHP/*Hello*/?>
But this (correctly) doesn't output anything...
<?/*Hello*/?>
If you put code after the comment it is worse.
<?PHP/*Hello*/
print "Hello";
?>
This actually dies with a "parser error", but again this
works if you use the shorter tag.
<?/*Hello*/
print "Hello";
?>
Outputs "Hello" as expected.
The fact that it works when you use "<?" instead of "<?PHP" is what
leads me to believe this is a bug and not just a feature of the
language. Surely they should both behave the same?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16066&edit=1