Re: [PHP] Is this a bug?
- From: jochem@xxxxxxxxxxxxx (Jochem Maas)
- Date: Fri, 29 Aug 2008 23:26:02 +0200
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 :/
The script doesn't cause a parse error Instead it throws a warning.
Can you guys reproduce the error? I can actually give you a
link to the server where this code runs.
'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.
.
- Follow-Ups:
- Re: [PHP] Is this a bug?
- From: Thijs Lensselink
- Re: [PHP] Is this a bug?
- Prev by Date: Re: [PHP] Testing for Current pointer position in array during iteration
- Next by Date: Re: [PHP] ASCII Captcha
- Previous by thread: Re: [PHP] Testing for Current pointer position in array during iteration
- Next by thread: Re: [PHP] Is this a bug?
- Index(es):
Relevant Pages
|