Req #26411 [Com]: while {} else {}

From: Date: Tue, 27 Jun 2017 10:46:38 +0000
Subject: Req #26411 [Com]: while {} else {}
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-209700@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=26411&edit=1 ID: 26411 Comment by: php at pointpro dot nl Reported by: php at bellytime dot com Summary: while {} else {} Status: Wont fix Type: Feature/Change Request Package: Scripting Engine problem Operating System: * PHP Version: * Block user comment: N Private report: N New Comment: This syntax would indeed be great. I see that the vote was not passed at the RFC, but I don't see any argumentation why. Other languages don't have it is not true, and also not a reason to not add it. What are arguments against having such a useful construct? Previous Comments: ------------------------------------------------------------------------ [2017-06-17 16:28:03] rageclick at gmail dot com I almost never join conversations or write comments online but I would also love to see this feature as well. It's just nicer, easier to look at and it uses less code which is what I go for. However... if there is a reason behind why you won't do this, I would understand. while ($result = $get->fetch_assoc()) { $in=1; echo 'Something'; } if(!$in){ echo 'Nothing'; } WHEN I could be doing this while ($result = $get->fetch_assoc()) { echo 'Something'; }else{ echo 'Nothing'; } ------------------------------------------------------------------------ [2016-05-10 13:56:48] asd at asd dot asd Hey, it's an awesome feature everyone would like. Let's reject it! ------------------------------------------------------------------------ [2016-05-04 13:26:08] nikic@php.net Related To: Bug #72148 ------------------------------------------------------------------------ [2015-06-10 12:11:38] cmb@php.net Related To: Bug #67843 ------------------------------------------------------------------------ [2014-10-12 14:24:55] nikic@php.net Closing as Wfx as this feature was rejected in https://wiki.php.net/rfc/loop_or. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=26411 -- Edit this bug report at https://bugs.php.net/bug.php?id=26411&edit=1

« previous php.bugs (#209700) next »