Ver Mensaje Individual
  #6 (permalink)  
Antiguo 07/10/2011, 18:24
loluchis
 
Fecha de Ingreso: octubre-2011
Mensajes: 37
Antigüedad: 12 años, 6 meses
Puntos: 9
Respuesta: unset heredando de ArrayIterator

Código PHP:
class Coleccion extends ArrayObject
{
    
    public function 
clear()
    {
    
$iterator $this->getIterator();

    foreach(
$iterator as $key => $value)
        
$this->offsetUnset($key);
    }


resultado:

NOTICE Coleccion::clear(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid