Req #54802 [Opn->Csd]: Request for Alternative Syntax Control Structure for foreach

From: Date: Tue, 17 May 2011 22:04:29 +0000
Subject: Req #54802 [Opn->Csd]: Request for Alternative Syntax Control Structure for foreach
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-160794@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=54802&edit=1 ID: 54802 User updated by: tobiasoleary at mac dot com Reported by: tobiasoleary at mac dot com Summary: Request for Alternative Syntax Control Structure for foreach -Status: Open +Status: Closed Type: Feature/Change Request Package: Output Control Operating System: Mac OS X PHP Version: 5.3.6 Block user comment: N Private report: N New Comment: Feature has already been added. I was being a dumb dumb. Previous Comments: ------------------------------------------------------------------------ [2011-05-18 00:01:09] tobiasoleary at mac dot com Description: ------------ --- From manual page: http://www.php.net/control-structures.alternative-syntax --- Request for Alternative Syntax Control Structure for foreach I would like to do this: <ul> <?php foreach($myarray as $myvalue): ?> <li><? print $myvalue; ?></li> <?php endforeach; ?> </ul> Test script: --------------- <ul> $myarray = array(1, 2, 3); <?php foreach($myarray as $myvalue): ?> <li><? print $myvalue; ?></li> <?php endforeach; ?> </ul> Expected result: ---------------- Generate a html list with 3 list items containing the text 1, 2, and 3, respectively. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=54802&edit=1

« previous php.bugs (#160794) next »