Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78954 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19106 invoked from network); 18 Nov 2014 20:21:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Nov 2014 20:21:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=php-php-dev@m.gmane.org; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=alex@kurilo.me; sender-id=unknown Received-SPF: pass (pb1.pair.com: domain m.gmane.org designates 80.91.229.3 as permitted sender) X-PHP-List-Original-Sender: php-php-dev@m.gmane.org X-Host-Fingerprint: 80.91.229.3 plane.gmane.org Received: from [80.91.229.3] ([80.91.229.3:34316] helo=plane.gmane.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 47/02-06737-52AAB645 for ; Tue, 18 Nov 2014 15:20:56 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XqpGY-0006ey-6b for internals@lists.php.net; Tue, 18 Nov 2014 21:20:46 +0100 Received: from 216.250.250.254 ([216.250.250.254]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 18 Nov 2014 21:20:46 +0100 Received: from alex by 216.250.250.254 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 18 Nov 2014 21:20:46 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: internals@lists.php.net Date: Tue, 18 Nov 2014 15:20:34 -0500 Lines: 24 Message-ID: References: <546B0F62.1090705@gmail.com> <546B9739.6060904@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 216.250.250.254 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: <546B9739.6060904@gmail.com> Subject: Re: [PHP-DEV] [RFC] Default constructors From: alex@kurilo.me (Alexander Kurilo) On 18/11/14 14:00, Stanislav Malyshev wrote: > Hi! > >> Thanks for bringing this up and working on the patch. >> Last time we discussed >> this(http://www.serverphorums.com/read.php?7,712222,712635), there were >> a couple of people including Anthony and Sanford who were agains this >> feature arguing that it would encourage bad practices so I think it > > Obviously, I disagree with that. I do not see any bad practices it > encourages - if anything, it encourages the good practice of always > calling parent ctor, practice considered so good by many that some > languages make it mandatory. However, Java lets one have as many constructors as one wants because Java supports overloading and there's a default constructor that takes no arguments. Does it *really* make sense for PHP? What if that parent class 'Animal' from your example introduces a constructor that accepts, say, both `$owner` and `$what` as mandatory arguments? `parent::__construct()` call in a descendant will appear broken (unintentionally, I suppose), won't it? That'll work in Java just fine, though.