is any compile time configuration needed to make 'overload()' function to work ?. when I use the below code it's saying 'undefined function overload'.
Hope some light on this. Thanks in advance. > <?php > class OO > { > var $a = 111; > var $elem = array('b' => 9, 'c' => 42); > > function __get($prop_name, &$prop_value) > { > if (isset($this->elem[$prop_name])) { > $prop_value = $this->elem[$prop_name]; > return true; > } else { > return false; > } > } > > // Callback method for setting a property > function __set($prop_name, $prop_value) > { > $this->elem[$prop_name] = $prop_value; > return true; > } > } > > overload('OO'); > > $o = new OO; > print "\$o->a: $o->a\n"; // print: $o->a: > print "\$o->b: $o->b\n"; // print: $o->b: 9 > print "\$o->c: $o->c\n"; // print: $o->c: 42 > print "\$o->d: $o->d\n"; // print: $o->d: > > // add a new item to the $elem array in OO > $o->x = 56; > > $val = new stdclass; > $val->prop = 555; > > $o->a = array($val); > var_dump($o->a[0]->prop); > > ?> <[EMAIL PROTECTED]> ------------------------------------------------------------------- We must use time wisely and forever realize that the time is always ripe to do right." -- Nelson Mandela ------------------------------------------------------------------- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php