# php-src/TODO foreach-enhancements

- Thread: https://externals.io/message/9628
- Original archive: https://news-web.php.net/php.internals/9628
- Started by mfischer@gjat.josefine@Markus Fischer on 2004-05-02T09:17:51+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #9628 — mfischer@gjat.josefine@Markus Fischer — 2004-05-02T09:17:51+00:00

URL: https://externals.io/message/9628#9628

Hi,

    has anyone played around with those two subjects from php-src/TODO ?

    * Allow foreach ($array as $k => list($a, $b)) syntax for multi
      dimensional arrays.

    * Allow foreach ($array as $k => &$val) syntax. right now we cannot
      traverse an array without copying each element.


    I'm just curious to know if someone has worked on this recently.

    cheers,

        - Markus

---

## #9629 — Wez Furlong — 2004-05-02T11:11:18+00:00

URL: https://externals.io/message/9628#9629 · In reply to: #9628

The latter of these is in PHP 5 afair.

--Wez.

----- Original Message ----- 
From: "Markus Fischer" <mfischer@gjat.josefine.at>
To: <internals@lists.php.net>
Sent: Sunday, May 02, 2004 10:17 AM
Subject: [PHP-DEV] php-src/TODO foreach-enhancements


>     Hi,
> 
>     has anyone played around with those two subjects from php-src/TODO ?
> 
>     * Allow foreach ($array as $k => list($a, $b)) syntax for multi
>       dimensional arrays.
> 
>     * Allow foreach ($array as $k => &$val) syntax. right now we cannot
>       traverse an array without copying each element.

---

## #9641 — Derick Rethans — 2004-05-03T08:51:09+00:00

URL: https://externals.io/message/9628#9641 · In reply to: #9628

>     * Allow foreach ($array as $k => &$val) syntax. right now we cannot
>       traverse an array without copying each element.

Works in PHP 5.

Derick
