From:             rayro at gmx dot de
Operating system: Windows XP
PHP version:      5.3.0
PHP Bug Type:     Class/Object related
Bug description:  __call is not able to handle private functions in extended 
classes

Description:
------------
While public functions will be called on the extended class, private will
not. If you define a "test" function in the Foo class, the function on the
extended class will be called like expected. Code is self-explaining this
"problem"...

Reproduce code:
---------------
abstract class Foo {
        function __call($f, $a) {
                return call_user_func_array(array($this, $f), $a);
        }
        // uncomment this: private function test() { }
}
class Bar extends Foo {
        private function test($a) {
                var_dump($a);
        }
}
$bar = new Bar();
$bar->test('hello');

Expected result:
----------------
string(5) "hello"

Actual result:
--------------
endless loop

-- 
Edit bug report at http://bugs.php.net/?id=49328&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=49328&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=49328&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=49328&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=49328&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=49328&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=49328&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=49328&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=49328&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=49328&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=49328&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=49328&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=49328&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=49328&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=49328&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=49328&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=49328&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=49328&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=49328&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=49328&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=49328&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=49328&r=mysqlcfg

Reply via email to