<?php $tablica = new A; $tablica[1][2] = "cokolwiek"; ?>
I jeśli się da to jak to zrobić?
Zaznaczę, że wiem jak rozwiązać problem w przypadku jednego wymiaru:)
//do Moda: zapomniałem o dziale obiektowym, a opcji "usuń post" nie widzę.
<?php $tablica = new A; $tablica[1][2] = "cokolwiek"; ?>
<?php class A implements ArrayAccess { public function __construct( $array ) { foreach ( $array as $k => $v ) $this->_array[$k] = new A( $v ); else $this->_array[$k] = $v; } public function offsetExists( $offset ) { } public function offsetGet( $offset ) { return $this->_array[$offset]; } public function offsetSet( $offset, $value ) { $this->_array[$offset] = $value; return true; } public function offsetUnset( $offset ) { return true; } } ?>