Re: [PHP4BETA] Question about "#" comments
| From: | Teodor Cimpoesu | Date: | Mon, 06 Mar 2000 16:39:53 +0000 |
| Subject: | Re: [PHP4BETA] Question about "#" comments | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-11596@lists.php.net to get a copy of this message | ||
Paul DuBois wrote:
>
> 4.0b5-dev
>
> I have the following script:
>
> <?php
> print "This should appear.\n";
> # ?>
> This should not appear?
> # <?php
> print "This should appear.\n";
> exit ();
> ?>
>
> Note the "#" comment on the third line. Should that line be treated
> as a comment? I would have thought so, but this is the output from
> the script:
Nope, the php statements on that line will be ignored, but the ending
tag is different beast.
> This should appear.
> This should not appear?
> # This should appear.
>
> It seems that the "?>" on the third line took precedence over the
> comment character. Is this the expected behavior?
AFAIK yes. Just think that the tags are like saying to the parser
"<?php = now read, ?> = now skip"
--
CIMPOESU Teodor, Web Programmer
@ DIGICOM S.A. Bucharest, Romania
@ Internet, site development
@ see http://internet.digiro.net/