ID:               16066
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Linux (Debian)
 PHP Version:      4.1.1
 New Comment:

How about a decent warning/error when you miss the space then?... At
the moment you either get (with all warnings on) "Warning: Use of
undefined constant PHP - assumed 'PHP' or it's dies with a "parser
error" at line whatever, depending what you have put after the <?PHP
token.

As a programmer I am quite curious to know how the start token has been
implemented, it is obviously a lot more complicated than it looks...I
thought it would be (sudo-code :)

if token="<?" or token="<%" or token="<?PHP" then
    start_php
else
    don't.
end if

(...hmmm actually that's VB, not sudo code! - my deepest apologies) but
judging from the behaviour it would seem that it looks for "<?" or "<%"
and then if there is a "PHP " it simply ignores it? whereas "PHP"
(without the space) doesn't match so it thinks its a constant.

Or is this all to do with delimiting characters?  obviously with
something like <?PHPprint"Hello";?> the scanner would not find a
delimiter so I assume you'd end up with a token "PHPprint" ? which the
parser doesn't understand.

I digress... an error message is all I ask.


Previous Comments:
------------------------------------------------------------------------

[2002-03-18 06:26:24] [EMAIL PROTECTED]

<?php is XML compliant, and in XML you need to
put a spacw there. While <? is a shortcut, and
as usual, people would like to use it in the
short way, with no space after it, like
<?=SID?>

Goba

------------------------------------------------------------------------

[2002-03-18 04:07:26] [EMAIL PROTECTED]

I totally agree that you 

<?phpprint_r($GLOBALS)?> 

is horrible.

The reason I found this problem was that I was commenting out a section
of HTML using PHP tags.  I just stuck in
<?PHP/* and */?> but it confused me when it didn't work.

If this space is a requirement it really should be mentioned somewhere
in the documentation.  I'm going to stick a comment on the "Basic
Syntax" section of the manual, where it talks about these tags.  

I do still think they should all be consistant though. ;o)

------------------------------------------------------------------------

[2002-03-15 21:06:49] [EMAIL PROTECTED]

Apperently, short tag does not need spaces after open tag :)
However, there is nothing wrong and there is nothing we should fix
here.

i.e. Changing "<?php" open tag without following spaces is not good
idea at all.

I'm sure you agree following code is ugly.
<?phpprint_r($GLOBALS)?> 
while
<?print_r($GLOBALS)?>
is not.



------------------------------------------------------------------------

[2002-03-15 07:46:38] [EMAIL PROTECTED]

Funny... If (as you claim) this:

<?/*Hello*/
print "Hello";
?>

is not a PHP script, howcome PHP actually prints out "Hello" in this
situation? (with no warnings or errors) Is PHP in the habit of running
code that is "not PHP script" ?

So far both of your reasons for marking this bug as "bogus" have
contradicted this example, which was in my original bug report and is
something you could easily reproduce yourself.  This gives me the
impression that either you've not bothered reading my comments, you
haven't understood what I'm saying or you think its not important
enough to be worth fixing so you're making up lame excuses.

Please read this bug report properly and think about it before marking
it as "bogus" again.  If you don't understand it or can't be bothered
with it please refer it to someone who does/can, rather than just
closing it.

Whatever response you do give, PLEASE make sure it doesn't contradict
something I've already explained, that is very frustrating.

------------------------------------------------------------------------

[2002-03-15 06:59:01] [EMAIL PROTECTED]

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.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/16066

-- 
Edit this bug report at http://bugs.php.net/?id=16066&edit=1

Reply via email to