View Single Post
  #1  
Old 06-24-2006, 12:42 PM
JustBreathe JustBreathe is offline
Registered User
Join Date: Jun 2006
Posts: 59
JustBreathe is on a distinguished road
foreach missing element!

PHP Code:
function onCreated()
  {
  
temp.var = {1,2,3};
  for ( 
temp.vtemp.var )
    {
    echo( 
temp.);
    if ( 
temp.== )
      
temp.var.removetemp.);
    }
  } 
Output:
PHP Code:
1

That is... When you remove an index within a for ( element: array ), the following element is skipped... That is, the index of the array isn't backed up by the amount of indexes deleted/removed.
Reply With Quote