Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88508 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94998 invoked from network); 26 Sep 2015 07:27:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Sep 2015 07:27:11 -0000 Authentication-Results: pb1.pair.com header.from=pajousek@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pajousek@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.172 as permitted sender) X-PHP-List-Original-Sender: pajousek@gmail.com X-Host-Fingerprint: 209.85.213.172 mail-ig0-f172.google.com Received: from [209.85.213.172] ([209.85.213.172:33614] helo=mail-ig0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 34/0B-31991-EC846065 for ; Sat, 26 Sep 2015 03:27:10 -0400 Received: by igbkq10 with SMTP id kq10so26200024igb.0 for ; Sat, 26 Sep 2015 00:27:08 -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:content-transfer-encoding; bh=Q8RYvJpDof8lrQxWGJLcci4DvmwgWz/5/iCOLc4leiE=; b=ERpBK3pqVg6F/Zuqv/Bh8fATxlQYC5z+PrVa2WBoLrX0lgZjBEGRAHks3x2yplT8Xd Ch2WHxX80aV+cFARjQ9rXU5ZFsW9GxnrG2mmZo4Dk72Zq4oWsg7NWLCA/x/sdv553vdH pOkd7exZ+YNqa9Ftul7JN4G1OJB5Mg2MLA+I9LVd87VHKKTp5l+9MJ562mheDcvlg2KE bkvL7lezk1mU/9gvktfM/mjZ0brc+I86SrUj7YGUYnVd1ksoBZYFgxPQZm8+XfEL2Pb2 k7UCbDEPGDoJPnlysRy9h3jciKv045zfsnFjedygBCOjLCYFxTsB2eNs80WzP1NtMM2+ sjNw== MIME-Version: 1.0 X-Received: by 10.50.118.67 with SMTP id kk3mr6789876igb.65.1443252427802; Sat, 26 Sep 2015 00:27:07 -0700 (PDT) Received: by 10.107.189.132 with HTTP; Sat, 26 Sep 2015 00:27:07 -0700 (PDT) In-Reply-To: <5605C23D.6030104@gmail.com> References: <5605BACE.30803@gmail.com> <5605C23D.6030104@gmail.com> Date: Sat, 26 Sep 2015 09:27:07 +0200 Message-ID: To: Stanislav Malyshev Cc: Dominic Grostate , PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Implementing Generics, and none scalar default properties. From: pajousek@gmail.com (=?UTF-8?Q?Pavel_Kou=C5=99il?=) On Fri, Sep 25, 2015 at 11:53 PM, Stanislav Malyshev wrote: > Hi! > >> I'm thinking primarily of the benefit to base or abstract classes. For > > Both can have constructors. > >> base classes which expect certain properties be set, they are exposed to >> the danger of remaining unset if the derived class overrides the >> constructor without calling the parent. > > You should always call the parent ctor. There's pretty much no reason to > ever not to call parent ctor. > > -- > Stas Malyshev > smalyshev@gmail.com > Since there is no reason not to call parent ctor, maybe PHP should somehow make every class have default empty ctor, if it doesn't have one defined already - so you can write automatically parent::__construct() everywhere? Regards Pavel Kou=C5=99il