PHP 4.0 Bug #9552: array_walk and classes
| From: | bbak at wob dot ag | Date: | Mon, 05 Mar 2001 00:18:07 +0000 |
| Subject: | PHP 4.0 Bug #9552: array_walk and classes | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-47933@lists.php.net to get a copy of this message | ||
From: bbak@wob.ag
Operating system: Linux
PHP version: 4.0.4pl1
PHP Bug Type: Arrays related
Bug description: array_walk and classes
Well maybe noone will ever use array_walk in Classes, but this should at least be documented:
_________SCRIPT_____________
class foo {
var $files = array();
// CONSTRUCTOR
function foo() {
// fill up the files array
$this->files = $this->memberfunc_1();
// do something with the array
array_walk($this->files, "$this->memberfunc_2");
// or "memberfunc_2" or "this->memberfunc_2"
}
// create a unique filename and clean up the real filename
function memberfunc_2(&$c_arr) {
// do some stuff ....
}
} // end class
$bar = new foo();
____________END SCRIPT______________
This code leads to an Error Like :
Warning: Unable to call this->memberfunc_2() - function does not exist in .....
--
Edit Bug report at: http://bugs.php.net/?id=9552&edit=1