Re: What does it mean that break/continue syntax removed in PHP 5.4???

From: Date: Tue, 09 Aug 2011 15:40:45 +0000
Subject: Re: What does it mean that break/continue syntax removed in PHP 5.4???
References: 1  Groups: php.qa 
Request: Send a blank email to php-qa+get-65900@lists.php.net to get a copy of this message
PHP allows a syntax like while (true) { while (true) { if (do_something()) { break 1; } else { break 2; } } } So you can jump out multiple levels. PHP <= 5.3 also allows using break $i; where $i is an integer (in the above example 1 or 2 for instance) this was dropped. Please check the PHP docs for more on this feature. johannes On Tue, 2011-08-09 at 18:10 +0300, Nadav Vinik wrote: > This code won't be valid anymore? > > while(...) { continue; } > > What will be instead? > > thanks > Nadav >

« previous php.qa (#65900) next »