#21555 [NEW]: Possible extensions to alternative control syntax

From: Date: Thu, 09 Jan 2003 21:48:14 +0000
Subject: #21555 [NEW]: Possible extensions to alternative control syntax
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-29614@lists.php.net to get a copy of this message
From: gabe@bravenet.com Operating system: All PHP version: 4.3.0 PHP Bug Type: Feature/Change Request Bug description: Possible extensions to alternative control syntax The alternative control structure syntax (see http://php.benscom.com/manual/en/control-structures.alternative-syntax.php) is very useful for templating purposes. However, I miss the smarty-style 'else' clauses: foreachelse, whileelse etc. I would like to be able to do this: <?php foreach($array as $item): ?> // if array has items, this is repeated once per item <?php foreachelse: ?> // we get here if $array has no items, then exit <?php endforeach; > ...or this... <?php while($something == $somestate): ?> // repeated while condition is met <?php whileelse: ?> // if condition is never met we go here once and exit. <?php endwhile; ?> I think these additions would be fairly useful. -- Edit bug report at http://bugs.php.net/?id=21555&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=21555&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=21555&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=21555&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=21555&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=21555&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=21555&r=support Expected behavior: http://bugs.php.net/fix.php?id=21555&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=21555&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=21555&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=21555&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21555&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=21555&r=dst IIS Stability: http://bugs.php.net/fix.php?id=21555&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=21555&r=gnused

« previous php.bugs (#29614) next »