|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-09-15 08:07 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 04:00:01 2025 UTC |
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