note 118911 added to control-structures.break
| From: | Shinrai | Date: | Fri, 26 Feb 2016 05:09:26 +0000 |
| Subject: | note 118911 added to control-structures.break | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-205048@lists.php.net to get a copy of this message | ||
It should be noted prior to PHP 7 you could use break in much the way you could use return. However
as of PHP 7 this will produce a fatal error.
function a() {
if (1 === 1) {
break;
}
echo 'something';
}
The above will break in php 7 but will not produce any error in previous versions.
----
Server IP: 72.52.91.14
Probable Submitter: 173.58.164.49
----
Manual Page -- http://php.net/manual/en/control-structures.break.php
Edit -- https://master.php.net/note/edit/118911
Del: integrated -- https://master.php.net/note/delete/118911/integrated
Del: useless -- https://master.php.net/note/delete/118911/useless
Del: bad code -- https://master.php.net/note/delete/118911/bad+code
Del: spam -- https://master.php.net/note/delete/118911/spam
Del: non-english -- https://master.php.net/note/delete/118911/non-english
Del: in docs -- https://master.php.net/note/delete/118911/in+docs
Del: other reasons-- https://master.php.net/note/delete/118911
Reject -- https://master.php.net/note/reject/118911
Search -- https://master.php.net/manage/user-notes.php