note 14983 added to control-structures.break.php
| From: | georgeb at tech dot intelinet dot ro | Date: | Thu, 23 Aug 2001 08:54:03 +0000 |
| Subject: | note 14983 added to control-structures.break.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17017@lists.php.net to get a copy of this message | ||
return() does not perform an implicit break. The return() statement exists all the non-function
blocks within the current function AND the function block itself.
AFAIK issuing a break statement inside a function when there are no blocks from which to break will
give a fatal error. So you can never use break to exit a function, rather you must use an explicit
return() for this.
http://www.php.net/manual/en/control-structures.break.php