|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-09-04 23:28 UTC] chx@php.net
-Status: Open
+Status: Wont fix
[2018-09-04 23:28 UTC] chx@php.net
[2018-09-04 23:40 UTC] requinix@php.net
-Package: PHP Language Specification
+Package: *General Issues
[2018-09-04 23:40 UTC] requinix@php.net
[2018-09-13 20:24 UTC] leon at valkenb dot org
[2018-09-13 20:34 UTC] leon at valkenb dot org
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 21 08:00:02 2025 UTC |
Description: ------------ I'd like to see something like this in PHP (and all languages) procedure{ // Check simple statement if ($a = $b){ break; } // Check complex statement if ( ($a != $b) && ($c > $b) ) { break; } // All checks succeed. Do something. something(); } I write a good amount of code, and one of the annoyng things is not being able to simply create a process that can be broken out of without a loop. Often i will use a switch / case, but this is not a tidy solution since there is oten no requirement for a case. Test script: --------------- procedure{ // or could be just proc. I couldn't think of a better word // Check simple statement if ($a = $b){ break; } // Check complex statement if ( ($a != $b) && ($c > $b) ) { break; } // All checks succeed. Do something. print "Hello" }