You are here: Re: For gurus: bug in php? Recursive foreach dont work properly. « PHP Programming Language « IT news, forums, messages
Re: For gurus: bug in php? Recursive foreach dont work properly.

Posted by Jerry Stuckle on 04/12/07 12:44

Vince Morgan wrote:
> "Toby A Inkster" <usenet200703@tobyinkster.co.uk> wrote in message
> news:gr81f4-4kp.ln1@ophelia.g5n.co.uk...
>> Tamagafk wrote:
>>
>>> Hi! Looks like there is a bug in php. If I have function which uses
>>> foreach to run trough array recursively, the lop-level foreach
>>> interupted by lover-level foreach'es. If I use simply 'for' everything
>>> is ok.
>> It's not a bug -- it's a "feature". Internally, arrays in PHP have a
>> "pointer" (not in the C sense of the word) which points at the "current"
>
> Why not in the "C sense"?
> Something similar to an itterator in C++ ?
>
> TIA
> Vince
>
>

Vince,

Because in C a pointer is a memory location. It's not in PHP - just an
indicator to the current location in an array.

And no, it's not like an iterator - there are no methods you can use on
the internal pointer - only the array itself.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация