Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85478 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88997 invoked from network); 26 Mar 2015 20:19:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Mar 2015 20:19:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.160.175 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.160.175 mail-yk0-f175.google.com Received: from [209.85.160.175] ([209.85.160.175:34030] helo=mail-yk0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/23-00585-2C964155 for ; Thu, 26 Mar 2015 15:19:16 -0500 Received: by ykef74 with SMTP id f74so10377865yke.1 for ; Thu, 26 Mar 2015 13:19:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=tKTovmMbZ4o8KoAWUPUoAcdwflOvd4bRd0WdKKxeSCk=; b=U2gxZRjdWYuLSgU8Vgy/20O49WW3DFxu43phiqSo6ac2ZQOO7ZmCFtQYNWh+xdINuL 1iyDzG6OqwxfknVo4SgHnKBcfwGoLcp9GRH7+wIWmzfSCW5P2KjgsnZCjEPmwxUisc08 uPVYNsfq9eNOrFcPa6A2+fLYi6hLrejLb2dqD61RjjjtsLsuFedHyrXuNPI92cEOop2p rE4Kn7EiWlkyBV5+WFwb4Esw7xJ/ujOrs0PqnNvzo5c3GdofzrwDVrbbmvc+60mHemaG yuIIYirgz7lgSKS3N9KzM8xEGHvAAjjc4NSUsjrp5EYvj++dS31KCTme5izSVbpbFjzg T8rQ== X-Gm-Message-State: ALoCoQl+SQhOFYBbCjXlv2X92QgfvqwGFuSYkwVNc0ZEkXHgnvFaC7nSZtRd7S7axgXJcGDp7hZKHSsuisqQxfO2DY85oThMZIpKZM1LkBgv6alO74rpQdl1S99GnErqDnBGF0TIVd4mCRE8itgMZ3+atuX+V1Wwcg== MIME-Version: 1.0 X-Received: by 10.52.78.35 with SMTP id y3mr19178434vdw.5.1427401152384; Thu, 26 Mar 2015 13:19:12 -0700 (PDT) Received: by 10.52.248.36 with HTTP; Thu, 26 Mar 2015 13:19:12 -0700 (PDT) In-Reply-To: References: Date: Thu, 26 Mar 2015 23:19:12 +0300 Message-ID: To: Dan Ackroyd Cc: "internals@lists.php.net" , Nikita Popov Content-Type: multipart/alternative; boundary=001a11340382a3eb40051236bad0 Subject: Re: [PHP-DEV] [RFC][VOTE] Constructor behaviour of internal classes From: dmitry@zend.com (Dmitry Stogov) --001a11340382a3eb40051236bad0 Content-Type: text/plain; charset=UTF-8 Hi Dan, Your RFC is going to be accepted and I support the idea, however the patch looks a bit surprising to me. Actually, returning NULL from constructors wasn't simple :) We have special function to do this - zend_ctor_make_null() and some tricks in the VM. I made just a quick look over your patch but didn't find any references to them. I'll try to improve the patch on next week. Please don't commit it yet. Nikita, could you also take a quick look. Thanks. Dmitry. On Sun, Mar 15, 2015 at 7:09 PM, Dan Ackroyd wrote: > Hi List, > > The 'Constructor behaviour of internal classes' RFC is now in voting. > Please note, it's the coding standard that is being voted on. If > anyone thinks I've implemented the changes in a way that is less > awesome then there is no reason the changes couldn't be improved. > > Additionally, while writing the change I noticed some things that were > already present in the code, that are outside the scope of the RFC but > ought to be fixed for the release of PHP 7. > > * Multiple examples of a generic Exception being thrown rather than a > specific exception being thrown. > > * Code generating an error notice and throwing an exception. It should > be one or the other, not both. > > * The text of exceptions in Intl not always being as informative as > the error message, which could be improved. > > But as I said, the vote is on whether the standard behaviour of either > returning a working instance or throwing an exception, is the standard > behaviour we want in PHP. > > cheers > Dan > Ack > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a11340382a3eb40051236bad0--