Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76682 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40454 invoked from network); 19 Aug 2014 05:50:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Aug 2014 05:50:23 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.169 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.169 mail-vc0-f169.google.com Received: from [209.85.220.169] ([209.85.220.169:53120] helo=mail-vc0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AD/E3-14556-C95E2F35 for ; Tue, 19 Aug 2014 01:50:23 -0400 Received: by mail-vc0-f169.google.com with SMTP id le20so7042912vcb.0 for ; Mon, 18 Aug 2014 22:50:18 -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=mL4xzsaCeyO2/I+fw1vsxTpnyMkp8dcLDShSew6ozvU=; b=ai5qQw15fiVIct/j71TujiMLh1Rg2PCGlcrFyriPZjIrQ/6zm9RpvmH7waIFwCgjID tstLiC0RxV8biGcWc9dbxZsoPvUFVKJU7Xh8iRXeIwK8ejztMWjxDVtm3qY2zu6Ijssn QPhDmjFDMHXr+mVu1t1HWq48RDGdpeppBrPQb7ZpN5qtSYT9JEue86W0uqya8CyVbddx 04UMbn3B2Ztda81dj51pF5ubvmbEOj02x0Z0EqiRBx0CP7U4czBMwHQMTRXyE5jG53wa meypDgLqE+UJ2BemyG2XcFZHr/e9JTpOLahinHiPCjmfXfoyOeHcrKwo6eM/yUuOcnI2 czEg== X-Gm-Message-State: ALoCoQk/2ivx51oBv8x5H45AE3MGMq0ruy0GNwkAvEzCT12oTwyB6iVEd1dtEjwwk2Aawr/eOSaYLL13RpQXBhThF4CNMUo8zWsbiqpOvYC5+nRUq8rTXZUPa06Ah6WN8zeS3wnqwzgg MIME-Version: 1.0 X-Received: by 10.52.190.71 with SMTP id go7mr1087511vdc.28.1408427417874; Mon, 18 Aug 2014 22:50:17 -0700 (PDT) Received: by 10.52.110.170 with HTTP; Mon, 18 Aug 2014 22:50:17 -0700 (PDT) In-Reply-To: References: Date: Tue, 19 Aug 2014 09:50:17 +0400 Message-ID: To: Levi Morrison Cc: Andrea Faulds , Joe Watkins , ircmaxell@php.net, Nikita Popov , Xinchen Hui , PHP Internals Content-Type: multipart/alternative; boundary=001a1133ececef532a0500f50f1b Subject: Re: Optional Type Hinting From: dmitry@zend.com (Dmitry Stogov) --001a1133ececef532a0500f50f1b Content-Type: text/plain; charset=UTF-8 The patch looks good and seems to contain the necessary opcache changes. I'm not sure if you really need zend_return_hint.used and zend_return_hint.class_name_type (may be I just didn't analyze the patch deep enough). You may support "self" by setting zend_return_hint.class_name = GC(actrive_class_entry)->name. If return type hinting is unused then zend_function. return_hint should be NULL In PHP7 it may make sense to embed fields of zend_return_hint (zend_string return_class_name and zend_uchar return_type) directly into zend_function. It may keep the same memory usage for cases without return type hinting and decrease it with return type hinting. Thanks. Dmitry. On Tue, Aug 19, 2014 at 8:23 AM, Levi Morrison wrote: > On Mon, Aug 18, 2014 at 1:43 PM, Dmitry Stogov wrote: > > Hi Levi, > > > > The implementation is really not a problem. It must be quite simple and I > > may take care about it. > > The problem that we can't come to agreement on scalar type hinting for > years > > :( > > > > Thanks. Dmitry. > > > > > > On Mon, Aug 18, 2014 at 9:57 PM, Levi Morrison > > wrote: > >> > >> On Mon, Aug 18, 2014 at 8:21 AM, Dmitry Stogov wrote: > >> > I see your point. For me they just don't have a lot of sense without > >> > each > >> > other. > >> > >> I am the author of two of those RFCs. I've worked with several members > >> of the HHVM team so that any inconsistencies are planned and recorded > >> (or will be; I know of one inconsistency in return types that is not > >> currently recorded). > >> > >> I also am definitely not in favor of merging them, for the reasons > >> Andrea outlined. > >> > >> Also, Dmitry, if you have interest in working on the implementations > >> for these RFCs I'm sure Joe would appreciate the help (I know I > >> would). > > Joe was able to get it mostly completed in a really short period of > time, but there is some issue going on with opcache. I have forgotten > the details now, but I think it had to deal with the fact that the > types need to have delayed binding. Joe or Anthony, can you maybe give > more information here? > > Additionally, the implementation was built off of master because it > was created before PHPNG; I think I probably want to target PHP 7 > instead of 5.7 (again, PHP 7 was only being dreamed of then) so it > would need rebased at least. Here's the work by Joe and Anthony: > https://github.com/krakjoe/php-src/compare/returntypehinting > --001a1133ececef532a0500f50f1b--