ID:               49328
 Updated by:       col...@php.net
 Reported By:      rayro at gmx dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         Class/Object related
 Operating System: Windows XP
 PHP Version:      5.3.0
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Foo::__call() doesn't have access to Bar::test() since its private. I
can't see see the "problem" here.


Previous Comments:
------------------------------------------------------------------------

[2009-08-22 12:25:18] rayro at gmx dot de

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 this bug report at http://bugs.php.net/?id=49328&edit=1

Reply via email to