note 118711 added to control-structures.break
| From: | colool at mail dot ru | Date: | Fri, 22 Jan 2016 17:27:33 +0000 |
| Subject: | note 118711 added to control-structures.break | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-204751@lists.php.net to get a copy of this message | ||
Why the script displays "xxxxxxxxx" ?
<?php
$e=20;
while($e>1)
{
while($e>1)
{
while($e>1)
{
$e--;
if($e<10){break 2;}
}
}
echo'x';
}
?>
he should get out of the 2 cycles and infinite output "x"
but "$e--;" continues to operate
----
Server IP: 72.52.91.14
Probable Submitter: 141.101.13.13
----
Manual Page -- http://php.net/manual/en/control-structures.break.php
Edit -- https://master.php.net/note/edit/118711
Del: integrated -- https://master.php.net/note/delete/118711/integrated
Del: useless -- https://master.php.net/note/delete/118711/useless
Del: bad code -- https://master.php.net/note/delete/118711/bad+code
Del: spam -- https://master.php.net/note/delete/118711/spam
Del: non-english -- https://master.php.net/note/delete/118711/non-english
Del: in docs -- https://master.php.net/note/delete/118711/in+docs
Del: other reasons-- https://master.php.net/note/delete/118711
Reject -- https://master.php.net/note/reject/118711
Search -- https://master.php.net/manage/user-notes.php