Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55565 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 401 invoked from network); 20 Sep 2011 19:07:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Sep 2011 19:07:30 -0000 Authentication-Results: pb1.pair.com header.from=h.reindl@thelounge.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=h.reindl@thelounge.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain thelounge.net designates 91.118.73.15 as permitted sender) X-PHP-List-Original-Sender: h.reindl@thelounge.net X-Host-Fingerprint: 91.118.73.15 mail.thelounge.net Windows 98 (1) Received: from [91.118.73.15] ([91.118.73.15:60221] helo=mail.thelounge.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B9/92-18228-E64E87E4 for ; Tue, 20 Sep 2011 15:07:27 -0400 Received: from srv-rhsoft.rhsoft.net (openvpn-241.thelounge.net [10.0.0.241]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.thelounge.net (Postfix) with ESMTPSA id 9BAA298; Tue, 20 Sep 2011 21:07:22 +0200 (CEST) Message-ID: <4E78E46A.5030404@thelounge.net> Date: Tue, 20 Sep 2011 21:07:22 +0200 Organization: the lounge interactive design User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 MIME-Version: 1.0 To: Stas Malyshev CC: Gustavo Lopes , "internals@lists.php.net" References: <4E74E5A0.2030006@sugarcrm.com> <4E76320F.6010904@sugarcrm.com> <4E764137.9080507@sugarcrm.com> <4E7708FA.7080802@sugarcrm.com> <4E78D01C.6040909@sugarcrm.com> In-Reply-To: <4E78D01C.6040909@sugarcrm.com> X-Enigmail-Version: 1.3.2 OpenPGP: id=7F780279; url=http://arrakis.thelounge.net/gpg/h.reindl_thelounge.net.pub.txt Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC2876EAFEDC3A56976C441DE" Subject: Re: [PHP-DEV] __constructor parameter limitations. From: h.reindl@thelounge.net (Reindl Harald) --------------enigC2876EAFEDC3A56976C441DE Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable but it is not logical foo() in B can do anything with $a before or after parent::foo() and the caller does not need to know at any point that B has anything to do with the class A Am 20.09.2011 19:40, schrieb Stas Malyshev:Hi! On 9/19/11 2:32 AM, Gustavo Lopes wrote: > The thing if you introduce func_get_args() to the argument, any discuss= ion > about enforcing signatures becomes meaningless. One could argue this > should be allowed: > > class A { > function foo() {} > } > > class B extends A { > function foo($a) {} > } No, this can not be allowed because A's signature accepts any call, inclu= ding foo(), but B's only accepts one with at least one parameters, so LSP is broken here. That is regardless of wha= t A::foo() is doing inside, since arguments are going to be checked first. Having said that, even in this case I would probably not go as far as pro= ducing a fatal error - though E_STRICT would be OK here --=20 Mit besten Gr=C3=BC=C3=9Fen, Reindl Harald the lounge interactive design GmbH A-1060 Vienna, Hofm=C3=BChlgasse 17 CTO / software-development / cms-solutions p: +43 (1) 595 3999 33, m: +43 (676) 40 221 40 icq: 154546673, http://www.thelounge.net/ http://www.thelounge.net/signature.asc.what.htm --------------enigC2876EAFEDC3A56976C441DE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk545GoACgkQhmBjz394AnnD5QCfVbKhrBhMRJkMZJ5nw9iZbiBy hpIAnAvpGze/eVwIOa8t5qiOQpZgTArU =IrG5 -----END PGP SIGNATURE----- --------------enigC2876EAFEDC3A56976C441DE--