FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Comments legal? For loop legal?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Comments legal? For loop legal? [message #170525 is a reply to message #170524] Fri, 05 November 2010 22:55 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 11/5/2010 6:28 PM, Brian Smither wrote:
> Brian Smither<ignore(at)ignore(dot)com> wrote in
> news:Xns9E27A0232C8FFbhsmithergmailcom(at)216(dot)151(dot)153(dot)39:
>
>> // Digital Product : BEGIN
>>
>> Would a colon ever constitute a beginning or ending of a script block?
>
> This is my theory...
>
> There is such a concept as script blocks and control blocks.
>
> Knowing that single line comments terminate at the end of the line OR at
> the end of the script block, whichever comes first. (A lot of articles
> around the web neglect to mention that part.) So...
>

That's because you shouldn't have script block terminators in a comment.

> <?php
> echo "Line 1";
> // echo "Line 2"; ?>
> die("Last Line");
> <?php
> echo "Line 3"; ?>
>
> ...will NOT kill the script as anticipated.
>
> There is such a concept as an Alternative Control Structure (ACS)
> syntax. Example:
>

Just another way of doing the same thing.

> if(expression):
> elseif:
> else:
> endif;
>
> The theory...
>
> The ACS is acted upon in single-line comments.
>

Nope. Comments are comments

> Example:
>
> if(expression):
> // COMMENT : endif
> else:
> end; // maybe 'end' by itself is legal?
>
> Possible result: Unexpected T_ELSE error.
>

No, this will not cause such an error.

> NOTES:
> 1. Intentionally mixing structure styles can lead to unpredicable
> results.
> 2. Inadvertently mixing structure styles, even innocuous characters in
> comments, can lead to unpredicable results.
>

Nope. Results are 100% predictable, although this would not be
recommended because it would be confusing. And comments are comments -
and ignored.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: There is some framework/tool to generate PHP code
Next Topic: urls in php
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 15:50:24 GMT 2024

Total time taken to generate the page: 0.04528 seconds