Re: Will return break loop?

From: Date: Wed, 11 Sep 2002 22:05:30 +0000
Subject: Re: Will return break loop?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-116049@lists.php.net to get a copy of this message
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On September 11, 2002 15:57, Kevin Stone wrote: > 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. :) Yes - return will break a loop. Cheers! - --zak -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9f74qb6QONwsK8bIRAl+hAJwI4VaBj6IYtbjgHxGQkmq+Lg2iggCfYqOT gsTebidZ6s5u2tc5SC60IyM= =bywU -----END PGP SIGNATURE-----

« previous php.general (#116049) next »