Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #34847 : Overloading __call() does nothing on an extended class
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 19th April 00:24
php-bugs
External User
 
Posts: 1
Default #34847 : Overloading __call() does nothing on an extended class



From: junk at thinkof dot net
Operating system: OSX 10.4.2
PHP version: 5.0.5
PHP Bug Type: Class/Object related
Bug description: Overloading __call() does nothing on an extended class

Description:
------------
Overloading the function __call() results in __call() not be executed when
a class is extended. Having the __call() overload in the parent, child or
both makes no difference.

Reproduce code:
---------------
<?php
class extendable {
function blah (){
print 'blah';
}
}
class extendee extends extendable {
function __call ($method, $args){
print $method;
}
}
$test = new extendee ();
$test->blah ();
?>
<?php
class extendable {
function __call ($method, $args){
print $method;
}
function blah (){
print 'blah';
}
}
class extendee extends extendable {
}
$test = new extendee ();
$test->blah ();
?>
<?php
class b {
function blah (){
print "In method: blah";
}
}
class a extends b {
function __call ($method, $args){
print '__call(): '.$method;
}
}
$test = new a ();
$test->blah ();
?>

Expected result:
----------------
__call():blah
In method: blah

Actual result:
--------------
In method: blah

--
Edit bug report at http://bugs.php.net/?id=34847&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34847&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34847&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34847&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34847&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34847&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34847&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34847&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34847&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34847&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34847&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=34847&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=34847&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34847&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34847&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34847&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34847&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34847&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34847&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34847&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34847&r=mysqlcfg
  Reply With Quote


  sponsored links


2 19th April 00:25
php-bugs
External User
 
Posts: 1
Default #34847 : Overloading __call() does nothing on an extended class



ID: 34847
User updated by: junk at thinkof dot net
Reported By: junk at thinkof dot net
Status: Open
Bug Type: Class/Object related
Operating System: OSX 10.4.2
PHP Version: 5.0.5
New Comment:

Sorry, the reproduce code got scrambled a bit. It should be:


<?php
class b {
function blah (){
print "In method: blah";
}
}
class a extends b {
function __call ($method, $args){
print '__call(): '.$method;
}
}
$test = new a ();
$test->blah ();
?>

Expected result:
----------------
__call():blah
In method: blah

Actual result:
--------------
In method: blah


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

[2005-10-13 04:49:39] junk at thinkof dot net

Description:
------------
Overloading the function __call() results in __call() not be executed
when a class is extended. Having the __call() overload in the parent,
child or both makes no difference.

Reproduce code:
---------------
<?php
class extendable {
function blah (){
print 'blah';
}
}
class extendee extends extendable {
function __call ($method, $args){
print $method;
}
}
$test = new extendee ();
$test->blah ();
?>
<?php
class extendable {
function __call ($method, $args){
print $method;
}
function blah (){
print 'blah';
}
}
class extendee extends extendable {
}
$test = new extendee ();
$test->blah ();
?>
<?php
class b {
function blah (){
print "In method: blah";
}
}
class a extends b {
function __call ($method, $args){
print '__call(): '.$method;
}
}
$test = new a ();
$test->blah ();
?>

Expected result:
----------------
__call():blah
In method: blah

Actual result:
--------------
In method: blah


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


--
Edit this bug report at http://bugs.php.net/?id=34847&edit=1
  Reply With Quote
3 19th April 00:25
php-bugs
External User
 
Posts: 1
Default #34847 : Overloading __call() does nothing on an extended class


ID: 34847
User updated by: junk at thinkof dot net
Reported By: junk at thinkof dot net
-Status: Open
+Status: Bogus
Bug Type: Class/Object related
Operating System: OSX 10.4.2
PHP Version: 5.0.5
New Comment:

I was reading this wrong. This is my bad, sorry all.


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

[2005-10-13 04:52:15] junk at thinkof dot net

Sorry, the reproduce code got scrambled a bit. It should be:


<?php
class b {
function blah (){
print "In method: blah";
}
}
class a extends b {
function __call ($method, $args){
print '__call(): '.$method;
}
}
$test = new a ();
$test->blah ();
?>

Expected result:
----------------
__call():blah
In method: blah

Actual result:
--------------
In method: blah

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

[2005-10-13 04:49:39] junk at thinkof dot net

Description:
------------
Overloading the function __call() results in __call() not be executed
when a class is extended. Having the __call() overload in the parent,
child or both makes no difference.

Reproduce code:
---------------
<?php
class extendable {
function blah (){
print 'blah';
}
}
class extendee extends extendable {
function __call ($method, $args){
print $method;
}
}
$test = new extendee ();
$test->blah ();
?>
<?php
class extendable {
function __call ($method, $args){
print $method;
}
function blah (){
print 'blah';
}
}
class extendee extends extendable {
}
$test = new extendee ();
$test->blah ();
?>
<?php
class b {
function blah (){
print "In method: blah";
}
}
class a extends b {
function __call ($method, $args){
print '__call(): '.$method;
}
}
$test = new a ();
$test->blah ();
?>

Expected result:
----------------
__call():blah
In method: blah

Actual result:
--------------
In method: blah


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


--
Edit this bug report at http://bugs.php.net/?id=34847&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666