Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:3426 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21679 invoked from network); 15 Jul 2003 21:53:06 -0000 Received: from unknown (HELO ammma.de) (213.83.39.131) by pb1.pair.com with SMTP; 15 Jul 2003 21:53:06 -0000 Received: from ammma.net (ammma.net [62.225.101.66]) by ammma.de (8.11.6/8.11.6/AMMMa AG) with ESMTP id h6FLqXR31467 for ; Tue, 15 Jul 2003 23:52:33 +0200 Received: from neo.wg.de (jan.ammma.mil [192.168.100.11]) by ammma.net (8.9.3p2/8.9.3/AMMMa AG) with ESMTP id XAA08501 for ; Tue, 15 Jul 2003 23:53:03 +0200 Received: by neo.wg.de (Postfix, from userid 30) id 7802581826; Tue, 15 Jul 2003 23:53:02 +0200 (CEST) Received: from laptop.wg.de (laptop.wg.de [192.168.60.3]) by jan.dip.ammma.net (Horde) with HTTP for ; Tue, 15 Jul 2003 23:53:02 +0200 Message-ID: <1058305982.84dcf4471eff4@jan.dip.ammma.net> X-Priority: 3 (Normal) Date: Tue, 15 Jul 2003 23:53:02 +0200 To: internals@lists.php.net References: <3F0F128B.5070809@tonybibbs.com> <987141048.20030714223220@post.rwth-aachen.de> In-Reply-To: <987141048.20030714223220@post.rwth-aachen.de> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) 4.0-cvs X-Virus-Scanned: by AMaViS-perl11-milter (http://amavis.org/) Subject: Re: [PHP-DEV] php5 interfaces... From: jan@horde.org (Jan Schneider) Zitat von Marcus BXrger : > Hello Tony, > > Friday, July 11, 2003, 9:39:55 PM, you wrote: > > TB> In PHP5 I noticed this behaviou with interfaces. If I have an > interface > TB> with a method that takes no paramaters, an implementing class for > that > TB> interfaces can have the same method take parameters...is that right? > TB> For example: > > TB> interface foo { > TB> public function myFunction(); > TB> } > > TB> class foobar implements foo { > TB> public function myFunction($someText) > TB> { > TB> echo $someText; > TB> } > TB> } > > TB> $myObj = new foobar(); > $myObj->>myFunction('Testing, 1, 2, 3'); > > TB> This code works. To me it should flag an error or, at least a > warning, > TB> no? I can see the flexibility of allowing this as it provides a > kind-of > TB> form of overloading but I want to make sure this behaves as intended > TB> before I make use of this feature/bug. > > TB> --Tony > > > > PHP is a wek typed language....i see your point but we are not strict > typed. What does this have to do with typed languages? Interfaces are not types of method implementations or some such. There's also a warning if you call a function/method with too few or too much arguments, that seems much more similar to this case for me. Jan. -- http://www.horde.org - The Horde Project http://www.ammma.de - discover your knowledge http://www.tip4all.de - Deine private Tippgemeinschaft