Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97841 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59645 invoked from network); 17 Jan 2017 22:45:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jan 2017 22:45:32 -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.177 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.161.177 mail-yw0-f177.google.com Received: from [209.85.161.177] ([209.85.161.177:33994] helo=mail-yw0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 16/70-00729-B8E9E785 for ; Tue, 17 Jan 2017 17:45:31 -0500 Received: by mail-yw0-f177.google.com with SMTP id w75so100856546ywg.1 for ; Tue, 17 Jan 2017 14:45:31 -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; bh=4AqPcnSe5mF0UrDw28ERDGJCf9GFvQbptkic+ep7kKU=; b=lpLBMXNecmWtBqmV9F5zc7sAWOiDxL1pubvHxZ0hK3UZj9raW9RJGrNsgasRbjAfUJ pyQPIYUzSKYfYy55UHEAMBpgmpoDgNUwZEeWAyf4MrzYZX5zxZjyRdZFvvfZQUz/oHaj Ba3FKsiQ0OM2MMsQqvS52EiL5lZd4DU1ZwABt1Qro3W6RdgVz6s64v5g8aIqyWWMnbRq tI/emKFd/LuC6CTwv6Jsb7ps0urwUPwqLsg8VcgmHhdqtz4dhirr7rJ2bmlK/Rp1F2cj 0Tl9zYqa6Kr9qOH5mpbpP3A5V4wSwhiehetEVeZSr/xOmQDuHvVe7EoNq8X9pbNF5gr+ qtow== 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; bh=4AqPcnSe5mF0UrDw28ERDGJCf9GFvQbptkic+ep7kKU=; b=E1AZmCIgJg1TmEVfBnBEjKKtEh0BAqStqVOotyoIvL/crH1bR+h9NT9YbsS6neVsJS S4kuNnyNo859zDj+T2x26qJt8E/mFJv9C1IsWbECsrJc63npIl27Y+V9aMm/8Ncgs9Yf livk1jgEHw06KcK+VHXOjG+XCu1D/R1Ar5DYWcE7jP+rF+vcRLKVq9wvqheCrBlRlM0X HqsRnAFtr3lvnKgfnfSfElB+YSJ9VX3nqeK2L5TgC8hQsYbQk0qyjKVWGkQb8lftaQhX 1JHGmwhRdPU/oUi8+deQG7wi4YZaX32ZTFaNTrCcVdFm+rfQdJ9JUKC0KPsEHOBHX1JI tB6g== X-Gm-Message-State: AIkVDXK58WI0pIZpxnAwahFlJQsg+91LwLH25+I7CoAQiz2JLjHsjG7K8cQ3Ie8pqpAWAmar2U/Dn0VjamHrfQ== X-Received: by 10.129.154.197 with SMTP id r188mr36337ywg.324.1484693128024; Tue, 17 Jan 2017 14:45:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.80.215 with HTTP; Tue, 17 Jan 2017 14:45:27 -0800 (PST) In-Reply-To: References: Date: Tue, 17 Jan 2017 23:45:27 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary=94eb2c0bb4d47f1d920546520eae Subject: Re: [PHP-DEV] [RFC][DISCUSSION] - Disallow Multiple Constructor Calls From: nikita.ppv@gmail.com (Nikita Popov) --94eb2c0bb4d47f1d920546520eae Content-Type: text/plain; charset=UTF-8 On Tue, Jan 17, 2017 at 9:52 PM, Fleshgrinder wrote: > On 1/17/2017 9:48 PM, Nikita Popov wrote: > > 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 > > > > Hey Nikic! > > Thanks for skimming over it. I also though about implementation already. > My initial though was -- especially to keep it simple -- to simply > delete the method from the object's table. > > Not sure if this is possible or just introduced more problems than it > solves. Also considering that we think reflection should continue to > allow calling it multiple times, though this is obviously still debatable. > Methods are stored on the class, with the object containing a pointer to the class. As such, it's not possible to delete a method from a single object, you can only delete a method from the entire class. (In practice you can't do that either ^^) Nikita --94eb2c0bb4d47f1d920546520eae--