Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67487 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20208 invoked from network); 24 May 2013 12:11:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 May 2013 12:11:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.178 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.223.178 mail-ie0-f178.google.com Received: from [209.85.223.178] ([209.85.223.178:63333] helo=mail-ie0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A7/26-20943-1E85F915 for ; Fri, 24 May 2013 08:11:14 -0400 Received: by mail-ie0-f178.google.com with SMTP id f4so4665338iea.9 for ; Fri, 24 May 2013 05:11:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=6SNIVW+CqVthVWTdezO0vDrXj8ba934ly0PXeHXYzeM=; b=FQJMmzoLiOz0Drur2iZG83ktEfWGly5JRkTAKAavNtTH99Dz+UE3/GrVZpl2NzFNMG +3epafKOLZpVwt3wBkx5UTi6b6zgoL68HNngwKUJHTn40uSvxS6KLZlv1BcwBIqI3H2w 6q7DV+2s974bCb1K6F07miLS1kv5UOuBw3r2A1Q9J5ph6wSCR00ul6eNVT1/oQLzQjlt Fy7FT4wriPjIvGbFhXFfFAOncbwEnqdXdnsyfNXJt9PEYsppmjlR30uabqvLZDfYurSA bNRpbWVCXurTjxeL8vcnWOHJSQAOTKaB+KD0PnC9o19Fxnf/6ni2Oj3P0ORedzYjRElr stVA== MIME-Version: 1.0 X-Received: by 10.50.29.107 with SMTP id j11mr13340086igh.105.1369397470396; Fri, 24 May 2013 05:11:10 -0700 (PDT) Received: by 10.50.209.3 with HTTP; Fri, 24 May 2013 05:11:10 -0700 (PDT) In-Reply-To: <519E8ADB.90202@sugarcrm.com> References: <6b642a96e673c29dbaf2f239be15f7f6.squirrel@www.l-i-e.com> <519E8ADB.90202@sugarcrm.com> Date: Fri, 24 May 2013 14:11:10 +0200 Message-ID: To: Stas Malyshev , Etienne Kneuss , Anthony Ferrara Cc: Richard Lynch , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7bd760c4c786b804dd75b1fc Subject: Re: [PHP-DEV] Cannot call constructor From: tyra3l@gmail.com (Ferenc Kovacs) --047d7bd760c4c786b804dd75b1fc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, May 23, 2013 at 11:32 PM, Stas Malyshev wro= te: > Hi! > > > Right now, to avoid this situation, you have to do: > > if (method_exists(get_parent_class(), '__construct')) > > parent::__construct(); > > > > If you don't check for the method existing, you get: > > Fatal error: Cannot call constructor ... > > This makes a lot of sense. I think we also discussed this idea some time > ago, but it didn't go anywhere that time... last time it was discussed on the list: http://www.mail-archive.com/internals@lists.php.net/msg50504.html to summarize it: Etienne was arguing that for the concrete example (Spl classes) it would be better to make sure that the object is properly initialized so having a constructor in the spl classes. Anthony was the only one who was against the idea of removing the error when you call a parent constructor which doesn't (explicitly) have one. Otherwise everybody else seemed to agree with the above change and only the implementation was discussed: - we should remove the error completelly - we should make the error less serious (please don't do this) - we should always create a common ancestor for every class by default which have an empty constructor/destructor - we should always create an empty constructor/desctructor for every class without it. So maybe we could discuss this and based on the feedback create an rfc (with or without a vote for the alternative implementations). --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --047d7bd760c4c786b804dd75b1fc--