Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97829 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38777 invoked from network); 17 Jan 2017 20:48:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jan 2017 20:48:15 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.179 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.161.179 mail-yw0-f179.google.com Received: from [209.85.161.179] ([209.85.161.179:33228] helo=mail-yw0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BF/2C-00729-E038E785 for ; Tue, 17 Jan 2017 15:48:14 -0500 Received: by mail-yw0-f179.google.com with SMTP id l75so99024837ywb.0 for ; Tue, 17 Jan 2017 12:48:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=kOgeCr3MbOzLRJNzzjljRrHAppBvvSdi7K5aRFnvSSk=; b=Imbox61mDMj5QOb3HMtXQEGCjm3+MnzHNhoSET1S8aX86xXiI2ecZY69OoXmZzyGdj hhvscmlgt6AqdqRDgwIH2mQNAbOtzclyOwUPnlLKZob1/FpNMD+aBOZgtMnLQJbw4jcb t5Ps8wY/taaJegwF1bCY4i2RXaWUY8XcodxpWxsdUYuxhRYK+Acie5CUocEsFs9Kqzhv UX4SCdG1hM4fw7iCcNRqDTks0W3H7hqIDYwwUGF5B/uH/xxER3RqEeqNPRRyCXqocXHd c1uUKkuPOxGWsXYUiRYjxN3K1FhdWqhXrtZBoyopIjKSBGZbRo0B1VskUGAYygh8vrLw Fafw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=kOgeCr3MbOzLRJNzzjljRrHAppBvvSdi7K5aRFnvSSk=; b=p4aE7XwWpmCXwks+ztICEYkhesh5pwOPaMfXBh/1G8RRRrwrnVcmPlidMLSWvfbcVv G7foKubpKBz2BO67Dm700B0fyc0rQujri6KiT2z/O5de3yAtDykaTmdZr2HuMTy/iF8h kP2q5egQEscBbLbPH/hsC3s9/eejN8Vu2y5GVf0/SJ1z3MU8x4rrX1lksEfZNOuvs/aP lxnrg9iODj02z33TAIcKauGYXqF6QfA/woheP4P277Axfq4qWW/3UkZAlvLDxRTTK/27 ZJJap8iNBAqZ/XDbXeU9ISQqxeLPc1rQUNSS5gYY6mF+z5WcMZBFf1hdOC13nVYO6w47 Fjyg== X-Gm-Message-State: AIkVDXI9fhCgH3+PL8vZ1SQhj21rgnAuh28fr89vGzdpvYxALZ160y++2W1yZqwC81aG09yTjVVaQaR0cq/32g== X-Received: by 10.129.111.194 with SMTP id k185mr8125589ywc.328.1484686091509; Tue, 17 Jan 2017 12:48:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.80.215 with HTTP; Tue, 17 Jan 2017 12:48:10 -0800 (PST) In-Reply-To: References: Date: Tue, 17 Jan 2017 21:48:10 +0100 Message-ID: To: Tim Bezhashvyly Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a1147194a1687ad0546506b4f Subject: Re: [PHP-DEV] [RFC][DISCUSSION] - Disallow Multiple Constructor Calls From: nikita.ppv@gmail.com (Nikita Popov) --001a1147194a1687ad0546506b4f Content-Type: text/plain; charset=UTF-8 On Tue, Jan 17, 2017 at 9:17 PM, Tim Bezhashvyly wrote: > Dear internals, > > me and Richard Fussenegger came up with a RFC draft disallowing multiple > constructor calls - https://wiki.php.net/rfc/ > disallow-multiple-constructor-calls disallow-multiple-constructor-calls> > > Here is a Reddit discussion thread - https://www.reddit.com/r/PHP/ > comments/5okdac/php_rfc_disallow_multiple_constructor_calls/ < > https://www.reddit.com/r/PHP/comments/5okdac/php_rfc_ > disallow_multiple_constructor_calls/> > > Any suggestions are highly welcome. Thank you. > > Regards, > Tim Without putting a lot of though into this, the restriction sounds reasonable. However, it is not immediately clear to me how this can be implemented without adding a disproportionate amount of overhead for something which I would consider a rather minor feature. If an object only had a single constructor this would be a simple flag, but if you want to allow one call per each constructor in the hierarchy (i.e. you can call the constructor and each parent constructor once), this information needs to be stored somehow. The obvious way would be a hashset containing the constructors (or CEs) that have been called on the object, but I don't think this would be acceptable. Regards, Nikita --001a1147194a1687ad0546506b4f--