#30090 [NEW]: Outside interface method can be called inside method that using the interface

From: Date: Wed, 15 Sep 2004 05:53:24 +0000
Subject: #30090 [NEW]: Outside interface method can be called inside method that using the interface
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-66188@lists.php.net to get a copy of this message
From: mikarento at hotmail dot com Operating system: Windows 2000 PHP version: 5.0.0 PHP Bug Type: Class/Object related Bug description: Outside interface method can be called inside method that using the interface Description: ------------ Method who's parameter is object of particular interface should not invoke other method of its interface. Reproduce code: --------------- interface Printable{ public function print(); } interface Writeable{ public function write($text); } class ImplClass implements Printable, Writeable{ public function print(){ return 'hallo' } public function write($text){ //... echo 'written'; } } class Printer { public static function printIt(Printable p){ p->write('wow'); } } $a = new ImplClass(); Printer::printIt($a); // the result is 'written' Expected result: ---------------- error: Printable object doesn't have 'write' method Actual result: -------------- written -- Edit bug report at http://bugs.php.net/?id=30090&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30090&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30090&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30090&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30090&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30090&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30090&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30090&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30090&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30090&r=support Expected behavior: http://bugs.php.net/fix.php?id=30090&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30090&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30090&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30090&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30090&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30090&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30090&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30090&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30090&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30090&r=mysqlcfg

« previous php.bugs (#66188) next »