Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80342 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15239 invoked from network); 11 Jan 2015 02:09:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jan 2015 02:09:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.49 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.192.49 mail-qg0-f49.google.com Received: from [209.85.192.49] ([209.85.192.49:62865] helo=mail-qg0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8F/69-48183-D4BD1B45 for ; Sat, 10 Jan 2015 21:09:18 -0500 Received: by mail-qg0-f49.google.com with SMTP id f51so13881580qge.8 for ; Sat, 10 Jan 2015 18:09:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=L0Qy+2nV4fRUH2L3aMKLWTc0PLiaFgdYCo/VWFe7VQ8=; b=TYzlGJlo7s9n2kMsBLw9efefC9gZODCs5NRfWQ7mdeGgVeRa8D47kvFpUFlLmrHVSY ZKOZoOeJaXEQk/XsxHyS63K2dQv7wHS81nctyN4QQmnW72opccbxImlXBYxfOZA2LwRd hH5MQtzWcdBc9XhoYiNnRZ+TYQNtnJ66mfO5M6BI167f+oLqKqEPbfTZPnzSavgCROTR lVDu0N3/oRS+nFqI2eU4ACxmpGsxFjWJw+KRj5SD0McidNDYDbBeXxOWSCXT/DHJ1ypQ SWhuAvAlE+HGQ9KqgVrdljfXgzBhd5MNFZRDniBQo4d7B8VlvWP5qCxsgEUMJqralxg9 4mOg== X-Received: by 10.224.162.203 with SMTP id w11mr27959030qax.21.1420942155230; Sat, 10 Jan 2015 18:09:15 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.93.70 with HTTP; Sat, 10 Jan 2015 18:08:35 -0800 (PST) In-Reply-To: <54B1C50F.7020304@gmail.com> References: <54B1C50F.7020304@gmail.com> Date: Sun, 11 Jan 2015 11:08:35 +0900 X-Google-Sender-Auth: geUEe3h7HA2u39jxZwcqQkXGmGw Message-ID: To: Stanislav Malyshev Cc: PHP Internals Content-Type: multipart/alternative; boundary=089e0129557468b4cb050c56e09d Subject: Re: [PHP-DEV] [RFC][VOTE] Default parent constructors RFC From: yohgaki@ohgaki.net (Yasuo Ohgaki) --089e0129557468b4cb050c56e09d Content-Type: text/plain; charset=UTF-8 Hi Stas, On Sun, Jan 11, 2015 at 9:34 AM, Stanislav Malyshev wrote: > I'd like to initiate a vote on this RFC: > https://wiki.php.net/rfc/default_ctor > > TLDR: this RFC would make a call to parent::__construct() succeed (as in > "not produce a fatal error") even if the parent class does not define a > ctor. Same for __destruct and __clone. The motivation for it is in the > RFC and here: > https://php100.wordpress.com/2014/11/04/default-constructors/ > > I've chosen the simplest way of implementing it, as suggested by Dmitry, > in https://github.com/php/php-src/pull/990. There are other > alternatives, but I think the simpler the better. > > Previous discussion is at: http://marc.info/?t=141630266000001&r=2&w=2 > Nice RFC. It covers __clone(), __destruct() also. This would be great for rapid prototyping. Small comment to the patch. + (strcasecmp(Z_STRVAL_P(function_name), ZEND_DESTRUCTOR_FUNC_NAME) == 0 || + strcasecmp(Z_STRVAL_P(function_name), ZEND_CONSTRUCTOR_FUNC_NAME) == 0 || + strcasecmp(Z_STRVAL_P(function_name), ZEND_CLONE_FUNC_NAME) == 0)) { The comparison order would be better + (strcasecmp(Z_STRVAL_P(function_name), ZEND_CONSTRUCTOR_FUNC_NAME) == 0 || + strcasecmp(Z_STRVAL_P(function_name), ZEND_CLONE_FUNC_NAME) == 0 || + strcasecmp(Z_STRVAL_P(function_name), ZEND_DESTRUCTOR_FUNC_NAME) == 0)) { I suppose default constructor is used most, then clone, destructor. It depends on a script, though. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --089e0129557468b4cb050c56e09d--