RE: [PHP] dynamic/multidimensional arrays in classes

From: Date: Mon, 10 Mar 2003 07:30:01 +0000
Subject: RE: [PHP] dynamic/multidimensional arrays in classes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-138924@lists.php.net to get a copy of this message
> I'm having problems figuring this out. This first way gives me a 'Fatal > Error: Cannot use [] for reading in class.php on line xx' > > class myClass > { > var $arr = array(); > > function add_something( $value ) > { > $this->$arr[] = $value; // this is the line causing the error $this->arr[] = $value ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/

« previous php.general (#138924) next »