note 84295 deleted from control-structures.break by peehaa
| From: | peehaa@php.net | Date: | Wed, 22 Feb 2017 09:37:33 +0000 |
| Subject: | note 84295 deleted from control-structures.break by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208801@lists.php.net to get a copy of this message | ||
Note Submitter: cb
----
Just to note: break doesn't work within included file, results in fatal error.
main.php:
<?php
switch ( $i )
{
case '1': // Works
echo "$i";
break;
case '2': // Works
require( 'include1.inc' );
break;
case '3': // Doesn't work
require( 'include2.inc' );
break;
case '4': // Doesn't work, same reason
require( 'include2.inc' );
default: // Works
echo "$i";
}
?>
include1.inc:
<?php
echo "$i";
?>
include2.inc:
<?php
echo "$i";
break;
?>
I didn't find this documented anywhere.