Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78959 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32043 invoked from network); 18 Nov 2014 21:40:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Nov 2014 21:40:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.172 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.172 mail-wi0-f172.google.com Received: from [209.85.212.172] ([209.85.212.172:40029] helo=mail-wi0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6C/64-06737-9DCBB645 for ; Tue, 18 Nov 2014 16:40:42 -0500 Received: by mail-wi0-f172.google.com with SMTP id n3so3365245wiv.17 for ; Tue, 18 Nov 2014 13:40:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=Jt7Tz/fdxvs/PXMslCgRbUx2jq/gRfxMWVlpg3MxT48=; b=qSlIc1P9NmYKkZ05EJjqtZpkOcvPO5GvBB9YCa53zePRGxqO2whRRLg430iZ+ITTNx wG66+C3XccP56Svc8zKKjq4D5t0EhCgVHXofuFVwwlgn3bSeucdTcdsc/yIexd9GO5DB ZqqIJUf6MTW8fARMVEM8MalRRsKmPyGeDq4RyEO60QspAl8B1M1cNrvxgZJRmgHVjfXl ejxuNJ/xm6V36M1ZMsBtNLVa+oBf9soMP3gyboxY8sihv3l3EqsHBTo1gbif1642TcId W/pNX4llHwcCOxocTjoaPes2ETPuIFTkYW0qAA8RVWO3UNAx0BzNC0d9lrxT200i40E5 rXyQ== X-Received: by 10.180.75.199 with SMTP id e7mr7354269wiw.21.1416346838296; Tue, 18 Nov 2014 13:40:38 -0800 (PST) Received: from [192.168.0.2] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id wa10sm52726802wjc.8.2014.11.18.13.40.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Nov 2014 13:40:37 -0800 (PST) Message-ID: <546BBCC3.4090603@gmail.com> Date: Tue, 18 Nov 2014 21:40:19 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: internals@lists.php.net References: <546B0F62.1090705@gmail.com> <546B9739.6060904@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Default constructors From: rowan.collins@gmail.com (Rowan Collins) On 18/11/2014 20:20, Alexander Kurilo wrote: > 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? If you introduce a mandatory parameter to *any* function, method, or constructor, existing calls to that function, method, or constructor will be broken. A class with no defined constructor already behaves as if its constructor had no arguments when using "new", so introducing a constructor with mandatory arguments is already a breaking change. -- Rowan Collins [IMSoP]