From:             evertvandansen at ymail dot com
Operating system: Any
PHP version:      5.4.8
Package:          Unknown/Other Function
Bug Type:         Feature/Change Request
Bug description:Add alternate, more logical foreach syntax

Description:
------------
This is a very low priority request for adding an alternate foreach syntax.
Right 
now we write something like:
foreach ($cats as $cat)
Which is fine, but neither semantically nor grammatically correct. I would
propose 
that 
foreach ($cat in $cats) or foreach ($cat from $cats)
makes much more sense and is more readable. Not just from a grammatical
point of 
view, but also because that way the actual identifier you use in the
iteration is 
placed first.
The existing syntax should obviously remain, it is simply an alternate
syntax, not 
meant to substitute.
Again, it is not a very important request as it does not improve PHP
technically, 
only in regards to readability and (for some) usability.


-- 
Edit bug report at https://bugs.php.net/bug.php?id=63317&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63317&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63317&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63317&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63317&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63317&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63317&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63317&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63317&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63317&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63317&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63317&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63317&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63317&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63317&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63317&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63317&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63317&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63317&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63317&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63317&r=mysqlcfg

Reply via email to