#41162 [NEW]: Interface methods not implementable using __call

From: Date: Sun, 22 Apr 2007 13:11:39 +0000
Subject: #41162 [NEW]: Interface methods not implementable using __call
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-111775@lists.php.net to get a copy of this message
From: bugs dot php dot net dot nsp at cvogt dot org Operating system: Windows XP Professional SP2 PHP version: 5.2.1 PHP Bug Type: Class/Object related Bug description: Interface methods not implementable using __call Description: ------------ When implementing an interface one cannot use __call to implement methods as this will lead to a FATAL ERROR. However it would be quite convenient if one could do this. It would e.g. allow to generically pass on method calls to an object that is stored in a local variable and implements the interface. Reproduce code: --------------- interface MyInterface{ public function myMethod(); } class MyImplementation implements MyInterface{ public function __call( $method, $parameters ){ // do something } } Expected result: ---------------- __call takes care of not explicitly implemented methods declared in MyInterface. Actual result: -------------- Fatal error: Class MyImplementation contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (MyInterface::myMethod) -- Edit bug report at http://bugs.php.net/?id=41162&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41162&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41162&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41162&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41162&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41162&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41162&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41162&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41162&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41162&r=support Expected behavior: http://bugs.php.net/fix.php?id=41162&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41162&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41162&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41162&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41162&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41162&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41162&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41162&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41162&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41162&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41162&r=mysqlcfg

« previous php.bugs (#111775) next »