Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4438 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79264 invoked by uid 1010); 8 Sep 2003 23:51:34 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 79229 invoked by uid 1007); 8 Sep 2003 23:51:34 -0000 Message-ID: <20030908235133.79226.qmail@pb1.pair.com> To: internals@lists.php.net References: <20030831155609.91744.qmail@pb1.pair.com> Date: Mon, 8 Sep 2003 20:51:33 -0300 Lines: 32 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Posted-By: 200.196.104.198 Subject: Re: problem with interfaces From: cunha17@uol.com.br ("Cristiano Duarte") Did anyone think about it ? Any opinions ? Cristiano Duarte. "Cristiano Duarte" escreveu na mensagem news:20030831155609.91744.qmail@pb1.pair.com... > Hi all, > > Is this supposed to work? > > interface test { > function my_function ($mandatory_parameter); > } > > class test_class implements test { > function my_function ($mandatory_parameter, $optional_parameter = null) > { > } > } > > The test_class class implements correctly the 'test' interface since PHP > does not allow multiple explicit method declarations (explicit overloading). > > IMHO, if all additional parameters are optional, the interface commitment is > preserved. > > Cristiano Duarte