Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24821 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65720 invoked by uid 1010); 21 Jul 2006 11:19:13 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 65705 invoked from network); 21 Jul 2006 11:19:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jul 2006 11:19:13 -0000 X-PHP-List-Original-Sender: jared.williams1@ntlworld.com X-Host-Fingerprint: 81.103.221.48 mta08-winn.ispmail.ntl.com Solaris 8 (1) Received: from ([81.103.221.48:61561] helo=mtaout02-winn.ispmail.ntl.com) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id CF/67-29121-F28B0C44 for ; Fri, 21 Jul 2006 07:19:12 -0400 Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com with ESMTP id <20060721111908.PRHG27023.mtaout02-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com>; Fri, 21 Jul 2006 12:19:08 +0100 Received: from win2ks ([82.3.16.111]) by aamtaout01-winn.ispmail.ntl.com with ESMTP id <20060721111908.KGAB644.aamtaout01-winn.ispmail.ntl.com@win2ks>; Fri, 21 Jul 2006 12:19:08 +0100 Reply-To: To: "'Michael Wallner'" , Date: Fri, 21 Jul 2006 12:20:00 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 In-Reply-To: Thread-Index: Acaso2+use9Nf0nIRACw3koZYGmzvQAE7uAg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 Message-ID: <20060721111908.KGAB644.aamtaout01-winn.ispmail.ntl.com@win2ks> Subject: RE: [PHP-DEV] RfC: rethink OO inheritance strictness From: jared.williams1@ntlworld.com ("Jared Williams") References: > Hi (Marcus), > > unfortunately I'm not very happy with the direction OO > strictness takes > in PHP. I'm sure I'm not alone and many people second this feeling. > > > Precisely, let's have a look at the following: > > mike@honeybadger:~/build/php-5.2-debug$ cli > -d"error_reporting=8191" -r 'class c{function f(){}} class d > extends c{function f($a){}}' > Strict Standards: Declaration of d::f() should be compatible > with that of c::f() in Command line code on line 1 > > mike@honeybadger:~/build/php-unicode-debug$ cli > -d"error_reporting=8191" -r 'class c{function f(){}} class d > extends c{function f($a){}}' > Fatal error: Declaration of d::f() must be compatible with > that of c::f() in Command line code on line 1 > > > I *really* think that this enforcements are no good idea and > I _beg_ you that we leave this "area" to interfaces. > Not sure why this is necessary, why doesn't Class C { function f() { } } Class D { private $c; function __construct(C $c) { $this->c = $c; } function f($a) { } } work, with PHP's duck typing? Jared