Parsing ends with ? regardless if its a comment or not but its not
context sensitive. It can't understand that its within a string.
- S
Not exactly, it's only // comment style does not comment the tag while /* */
does.
The following script outputs its 'afafa':
?php
if(true){
/* echo
Yeah because /* */ has a clear end where // and # doesn't.
- S
On 8 Jul 2010, at 12:50, jvlad d...@yandex.ru wrote:
Parsing ends with ? regardless if its a comment or not but its not
context sensitive. It can't understand that its within a string.
- S
Not exactly, it's only // comment
Scott MacVicar wrote:
Yeah because /* */ has a clear end where // and # doesn't.
- S
Shouldn't the end of the line be always considered as a true end of the
one-line comment?
In other words, I think it always has a clear end too.
Similarly, lexer always regognizes the strings - their start and
On Fri, 2010-07-09 at 00:49 +0400, jvlad wrote:
Scott MacVicar wrote:
Yeah because /* */ has a clear end where // and # doesn't.
- S
Shouldn't the end of the line be always considered as a true end of the
one-line comment?
In other words, I think it always has a clear end too.
Hi
I'm not sure whether it's really a bug.
The following sample code will emit a parse error.
?php
if(true){
//echo '?php date('Y-m-d H:i:s'); ?';
echo 'afafa';
}
?
The parser treate the PHP tag within the commented line as a normal tag .
--
PHP Internals - PHP
The scanner is looking for \r \n % if ASP tags are enabled or ? before it
marks the end of the comment.
Take the following
?php
echo 'PHP';
// echo $moo; ? I am HTML, hear me roar!
Parsing ends with ? regardless if its a comment or not but its not context
sensitive. It can't understand that