<?php

class CArray
{

  protected $_data;

  public function __construct(Array $properties = array())
  {
    $this->_data = $properties;
  }

  public function __isset($property)
  {
    return isset ( $this->_data [$property] );
  }

  public function __set($property, $value)
  {
    return $this->_data [$property] = $value;
  }

  public function __get($property)
  {
    return array_key_exists ( $property, $this->_data ) ? $this->_data [$property] : null;
  }

  public function getKeys()
  {
    return array_keys ( $this->_data );
  }

  public function toArray()
  {
    return $this->_data;
  }
}

