RE: [PHP] comment followed by ?> fails to parse
| From: | Jonathan Rosenberg | Date: | Tue, 28 May 2002 20:56:37 +0000 |
| Subject: | RE: [PHP] comment followed by ?> fails to parse | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-99558@lists.php.net to get a copy of this message | ||
The parser needs to "emulate" the behavior of the HTML parser,
which will match the first ?> with the opening <? string. Make
sense?
> -----Original Message-----
> From: Leotta, Natalie (NCI/IMS)
> [mailto:LeottaN@ims.nci.nih.gov]
> Sent: Tuesday, May 28, 2002 4:41 PM
> To: 'Jonathan Rosenberg'; Johnson, Kirk;
> php-general@lists.php.net
> Subject: RE: [PHP] comment followed by ?> fails to parse
>
>
> But why wouldn't the parser skip right over a // line?
> it shouldn't even
> see anything in it.
>
> -----Original Message-----
> From: Jonathan Rosenberg [mailto:jr@tabbysplace.org]
> Sent: Tuesday, May 28, 2002 4:46 PM
> To: Johnson, Kirk; php-general@lists.php.net
> Subject: RE: [PHP] comment followed by ?> fails to parse
>
>
> BTW: if my last message was correct, this means that
> an occurrence of ?>
> embedded in a string literal will also cause problems.
>
> > -----Original Message-----
> > From: Johnson, Kirk [mailto:kjohnson@zootweb.com]
> > Sent: Tuesday, May 28, 2002 4:08 PM
> > To: php-general@lists.php.net
> > Subject: RE: [PHP] comment followed by ?> fails to parse
> >
> >
> > I have wondered for some time if this is a bug or just
> > an interesting design
> > choice ;) I agree with you, I was surprised when I
> > first encountered this.
> > But it is what it is, so code accordingly.
> >
> > Kirk
> >
> > > -----Original Message-----
> > > From: Thalis A. Kalfigopoulos [mailto:thalis@cs.pitt.edu]
> > > Sent: Tuesday, May 28, 2002 1:21 PM
> > > To: php-general@lists.php.net
> > > Subject: [PHP] comment followed by ?> fails to parse
> > >
> > >
> > > If I write a comment line with // and I include in
> > it ?> then
> > > it fails to parse the rest of the page because (i'm
> > guessing)
> > > the parser gets confused and goes off PHP mode.
> > > Is this normal? Shouldn't I be able to write
> literally ANYTHING on a
> > > comment line?
> > >
> > > Sample Code:
> > >
> > > <?
> > > //bla bla ?>
> > > $var=1;
> > > ?>
> > >
> > > Output:
> > >
> > > $var=1; ?>
> > >
> > >
> > > cheers,
> > > thalis
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>