Re: PHP5: Class behavior: method overloading

From: Date: Thu, 26 Feb 2004 18:58:38 +0000
Subject: Re: PHP5: Class behavior: method overloading
References: 1 2  Groups: php.general php.internals 
Request: Send a blank email to internals+get-8178@lists.php.net to get a copy of this message
Walter A. Boring IV wrote: > I say keep compatibility. If you want to enforce this, then declare an > interface. That is after all why they exist. > > Walt ... Would be nice if you could give a simple example - i really have problems working with interfaces :( My problem was to design a filesystem structure with classes like this: class Folder { var $name; var $path; function init() {} // should set $name and $path... function read($recursive = FALSE) {} // should read own content and eventually all subdirs } class File extends Folder { // inherited properties and funcs... function read() {} // should read the file content, $recursive is not needed } how could i implement my interfaces? I think interfaces wouldn't solve php4 compatibility problems... best regards, vivi

« previous php.internals (#8178) next »