|
Posted by julian_m on 07/07/06 20:02
Alvaro G. Vicario wrote:
> *** julian_m escribió/wrote (7 Jul 2006 11:35:08 -0700):
> > I cant think in any reason why this code fails...
> >
> > Commented line shuldn't be completely ignored by the parser?
> >
> > <?php
> >
> > // ?> whatever
>
> According to manual:
>
> The "one-line" comment styles only comment to the end of the line or the
> current block of PHP code, whichever comes first. This means that HTML code
> after // ... ?> or # ... ?> WILL be printed: ?> breaks out of PHP mode and
> returns to HTML mode, and // or # cannot influence that.
>
> It sounds like the logical option to me.
>
I didn't know that, now I understand how it works, although IMO, the
line I commented was not de end of the current block of PHP:
//$res= preg_replace('#<\s*(p|span|li|ul|ol)\s+.*?>#si', '<\1>',$str);
Note that ?> is a string there.
regards - julian
[Back to original message]
|