Hello internals,

The following code produces segfault using snapshot php5-200312191230.

<?php

class A implements ArrayAccess
{
    private $array = array();

    public function offsetExists( $offset )
    {
        return isset( $this->array[ $offset ] );
    }
    
    public function offsetGet( $offset )
    {
        return $this->array[ $offset ];
    }

    public function offsetSet( $offset, $data )
    {
        $this->array[ $offset ] = $data;
    }
    
    public function offsetUnset( $offset )
    {
        unset( $this->array[ $offset ] );
    }
}

$arr = new A();
$arr[] = 'Segfault here!';

?>  

Also when trying to do something like array_keys() on ArrayAccess
instance, error message is thrown. Will array functions support
ArrayAccess?
  

-- 
Best regards,
 Simeon                          mailto:[EMAIL PROTECTED]

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to