#38497 [Opn->Bgs]: Overloading does not work with extended classes (__call() never called)

From: Date: Sat, 16 Sep 2006 07:58:06 +0000
Subject: #38497 [Opn->Bgs]: Overloading does not work with extended classes (__call() never called)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-102271@lists.php.net to get a copy of this message
 ID:               38497
 Updated by:       johannes@php.net
 Reported By:      alessio dot bazzica at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Feature/Change Request
 Operating System: Mac OS X
 PHP Version:      5.1.5
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php

__call() is only called for undefined methods, DoSomething() is defined
in your class.


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

[2006-09-15 09:30:27] alessio dot bazzica at gmail dot com

Sorry, maybe I didn't explain the problem clearly. Sure 
child classes inherit parent's methods but my problem is 
another. I need to overload ParentClass::DoSomething() so I 
defined ChildClass::__call($method, $args) to call 
ChildClass::DoSomething_OVERLOAD() instead of 
ChildClass::DoSomething() (if $method is 'DoSomething'). It 
seems that PHP invoke DoSomething() before __call() on child 
class. In this case it is ALWAYS impossible to overload a 
parent method. My question is: "PHP denies parent method 
overloading or this could be a bug???". Thank you, Alessio

------------------------------------------------------------------------

[2006-09-14 20:52:05] tony2001@php.net

Childs DO inherit parent's methods.
No bug here, this is expected and well documented.

------------------------------------------------------------------------

[2006-09-14 20:31:49] alessio dot bazzica at gmail dot com

Please download a zip file containing my test case script at 
http://webapp.altervista.org/php_ovrldext_test.zip.
Recently I 
tried to run the script on other enviroments and there is the 
same problem. Thank you, Alessio

------------------------------------------------------------------------

[2006-08-29 01:00:00] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------

[2006-08-21 08:23:56] tony2001@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.



------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/38497

-- 
Edit this bug report at http://bugs.php.net/?id=38497&edit=1


Thread (7 messages)

« previous php.bugs (#102271) next »