ID:               44767
 User updated by:  ikickdogsforfun at hotmail dot com
 Reported By:      ikickdogsforfun at hotmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Gentoo Linux
 PHP Version:      5.2.6RC5
 New Comment:

Ah I see. Thanks for the explanation, it had puzzled me somewhat. As
for whose logic is right, it's not mine =P But thanks that's clarified a
few things for me.
I have also marked this bug as 'bogus' (If it will let me), I hope that
was correct =)


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

[2008-05-05 21:35:19] whitewolf24 at hotmail dot com

no, # is a ONE line comment. the end of the line ended the comment. 
as for the error. you should get them as that code would break anyway.

your lacking ; on the end of lines. {they are commented out}
nothing on the line after the first # is read by the parser. 

the problem your having is that your ending your code before it's
closed line three is ?> and the interpreter is seeing this and asking
you about the messed up syntax

<?
echo \"some ".
?>

these should be the two errors you are getting

Warning: Unexpected character in input:  '\' (ASCII=92) state=1 in file
on line 2

Parse error: syntax error, unexpected ';' in file on line 3

done believe me? try this line which is a code complete and doesn't
error

<?
echo "this ";#works# echo "works.";
?>

if you were right about your logic then you should get this works 
else if I'm correct you will just get this

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

[2008-05-02 13:27:13] ikickdogsforfun at hotmail dot com

In which case the comment is handled incorrectly if a second # appears,
note the code above which produces 2 errors. One of the errors refers to
a third line, even though there is only code on line. This suggests that
the interpretor has closed the comment and is attempting to handle the
rest of the code after the second # by treating it as a new line.

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

[2008-04-29 23:28:07] whitewolf24 at hotmail dot com

um, last I checked and have read in the manual
# comments to the end of the line OR the end of the php block, which
ever happens first. not to another #

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

[2008-04-17 20:49:53] ikickdogsforfun at hotmail dot com

Description:
------------
A # comment can be closed by a second # causing PHP to act rather
oddly. Any errors that occur on the same line but after the closing #
are reported as an error on the next line, however if there are no
errors anything after the second # is ignored and not processed as if it
was a comment. I think based on this, there needs to be some concistency
about what happens when a second # is encountered. Are these intended to
be embedded comments which can be be closed? Or should everything being
ignored after the first # untill a new line character is encountered?

Reproduce code:
---------------
This produces 2 errors, one on line 2, one on line 3, though they are
both about line 3:
<?
echo \"some ".# This is an imbedded comment#"text";
?>
This only echos out 'some':
<?
echo "some ".# This is an imbedded comment#"hi";
?>

Expected result:
----------------
I would expect to see 'some text' echoed out, as I was under the
impression these kinds of comments were imbedded.

Actual result:
--------------
See the code section


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


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

Reply via email to