From: knotwell at ix dot netcom dot com Operating system: PHP version: 4.3.1 PHP Bug Type: Class/Object related Bug description: class member functions aren't first class data objects
I've checked the documentation, but it doesn't address this issue. As a result, I'm unsure if this is a bug or by design. Anyhow, it appears class functions aren't first class data objects. I've included a short example leading to a "Call to undefined function" message as a example: <?php function generic_data_handler($specializedFn,$specializedFnData) { return $specializedFn($specializedFnData); } class z { var $x = 10; var $y = 4; function _mult($me) { return($me->x * $me->y); } function aStupidlyContrivedExample() { return generic_data_handler($this->_mult,$this); } } $a = new z; print $a->_mult($a); // an error from the runtime system print $a->aStupidlyContrivedExample(); ?> Apologies in advance if this is common knowledge or not a bug. -- Edit bug report at http://bugs.php.net/?id=24105&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=24105&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=24105&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24105&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24105&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24105&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=24105&r=support Expected behavior: http://bugs.php.net/fix.php?id=24105&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=24105&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=24105&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24105&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24105&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24105&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24105&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=24105&r=gnused