Re: Is this a bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



T Lensselink schreef:
Catalin Zamfir Alexandru, DATAGRAM SRL wrote:
Hello guys,

                I've been stalking on the list for some time. Didn't have
anything to report/talk, until now. I have a code like this, maybe you guys
can reproduce it, with output buffering started:

Echo 'something';

Echo 'another thing';

Echo 'something <br />'\;

                What happens is that ANYTHING that was echo'ed until that \,
will not reach the buffer. Although, this should actually be a Parse Error,
it isn't, it just echoes what was echoed after the god damned \. It took me
two hours to find this typo in the code .


ouch.
don't forget you can do:

$> php - l yourscript.php

to test for syntax errors (the warning does show up with this).

additionally a good syntax highlighting editor can help you to spot
stuff like this ... anything to stop the eyes from bleeding :/



                Can you guys reproduce the error? I can actually give you a
link to the server where this code runs.


The script doesn't cause a parse error Instead it throws a warning.

'PHP Warning:  Unexpected character in input:  '\' (ASCII=92) state=1 in'

Don't think it's a bug. And the reason there's no syntax error is
because the \ is a PHP
escape character.

is this character ever valid as an escape character outside of a string?
if it is that's news to me and if it isn't then really it is a bug ...
it should be a straight up parse error ... chances are that it's down
to limitations in the lexer?

the output buffer handler that seems to be swallowing the warning every
second request .... now that is weird.






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux