Re: Will return break loop?
| From: | Kevin Stone | Date: | Wed, 11 Sep 2002 22:12:46 +0000 |
| Subject: | Re: Will return break loop? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-116050@lists.php.net to get a copy of this message | ||
Thanks for really quick replies to my really quick question, everyone. Much
appreciated. :)
-Kevin
----- Original Message -----
From: "David Buerer" <david@pladesigns.com>
To: "'Kevin Stone'" <kevin@helpelf.com>; <php-general@lists.php.net>
Sent: Wednesday, September 11, 2002 3:42 PM
Subject: RE: [PHP] Will return break loop?
> really quik answer...
>
> yes.
>
> really long answer...
> from php manual:
>
> "the return() statement immediately ends execution of the current
function,
> and returns its argument as the value of the function call."
>
>
> -----Original Message-----
> From: Kevin Stone [mailto:kevin@helpelf.com]
> Sent: Wednesday, September 11, 2002 2:57 PM
> To: php-general@lists.php.net
> Subject: [PHP] Will return break loop?
>
>
> Really quick question. Will "return" break a loop inside a function?
>
> Example..
> myfunc()
> {
> while($val=0)
> {
> if ($i=128)
> {
> return true; //<-break or no?
> }
> }
> }
>
> I know I could easily figure this out my own but I do not have the means
to
> test it right now. :)
>
> Much thanks!
> Kevin
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>