ID:               37882
 Comment by:       ois at oisnot dot com
 Reported By:      php at bouchery dot com
 Status:           Open
 Bug Type:         Feature/Change Request
 Operating System: all
 PHP Version:      5.1.5CVS
 New Comment:

AS has been specified in comments here:
http://no2.php.net/manual/en/language.oop5.overloading.php

I think this should be set with the __set overload not __get though.


Previous Comments:
------------------------------------------------------------------------

[2006-06-22 07:39:23] php at bouchery dot com

Description:
------------
I would like to overload array access like this

<?php
class MyClass {
  private $parameters = array();

  function __set( $name, $value, $key ) {
    if( ! isset( $this->parameters[ $name ] ) ) {
      $this->parameters[ $name ] = array();
    }
    $this->parameters[ $name ][ $key ] = $value;
  }
}

$object = new MyClass;
$object->a[ 'x' ] = 'value';
?>



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37882&edit=1

Reply via email to