note 84295 added to control-structures.break
| From: | cb at osu1 dot php dot net | Date: | Tue, 08 Jul 2008 10:01:38 +0000 |
| Subject: | note 84295 added to control-structures.break | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-141262@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 212.124.37.9
Probable Submitter: 78.42.15.112
----
Manual Page -- http://www.php.net/manual/en/control-structures.break.php
Edit -- https://master.php.net/note/edit/84295
Del: integrated -- https://master.php.net/note/delete/84295/integrated
Del: useless -- https://master.php.net/note/delete/84295/useless
Del: bad code -- https://master.php.net/note/delete/84295/bad+code
Del: spam -- https://master.php.net/note/delete/84295/spam
Del: non-english -- https://master.php.net/note/delete/84295/non-english
Del: in docs -- https://master.php.net/note/delete/84295/in+docs
Del: other reasons-- https://master.php.net/note/delete/84295
Reject -- https://master.php.net/note/reject/84295
Search -- https://master.php.net/manage/user-notes.php