Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97701 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23741 invoked from network); 11 Jan 2017 20:46:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jan 2017 20:46:07 -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.170 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.161.170 mail-yw0-f170.google.com Received: from [209.85.161.170] ([209.85.161.170:33196] helo=mail-yw0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F4/36-55699-E8996785 for ; Wed, 11 Jan 2017 15:46:07 -0500 Received: by mail-yw0-f170.google.com with SMTP id l75so64010565ywb.0 for ; Wed, 11 Jan 2017 12:46:06 -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=VCcb7z3GCCOHR7U3j2KjxiRjQCBqbW8+3otHDmKgmzw=; b=ZMGlvne07WrCz8/o9NvuDf7p9/Oz0YWQeja55XEGBIo1ExaTRbbdFG1sdswEJ+V0Wm JPEUP5MSV7utAsCEOnBwRjaqw2CgD/lETrGJuILgk7ZobOZpdXSPn66myZERmpFW0TlU qabciGt74Cu90mf+JR4mk0tD6E7KsCmMTED1Zw+5AXd1uBij8K9kxGdRJPmUJ9vL8AyH CeK2aQzr00BdM4c7mzS+HS3dUhcN9wNVVrZxpLgDsWX8jh7nnTR0mf2Y6+3qyJwtYx0R FI7zU4B2lVQTqWUbcNIq6Bb87usg9NcjzU9NBRyTb3pbGXKzoH/nBDyHFXzTWnv4Wf8k EezQ== 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=VCcb7z3GCCOHR7U3j2KjxiRjQCBqbW8+3otHDmKgmzw=; b=tRSHsd50tV0hyoO0G0fSrBVmXnXMRsZTPSFlVeFkMB3Au+c5bwVqEpgXReuU1UbCgI TodwvuDr+QBv986gwLV3O7D3HXpKxwCZiIelTAvLBGCOfpJRYPcTYt2GSk7RnHwn85TT fLVsdDAVdkM+VIrVJX9iZis3TvpKATC3iss8dB5uMDl1w291+IgzYkA0ZUufu9YosvZN AErjb5fag/Wf3vxbKppInyxppeDME9RBWCtHQYxo13VJLhIWWqHEoF7rdCRSD8DFhAG3 Y5jBD51gGr4guD2aWZF7G3nzKoDlIU1yNHuxax7eLK2v7oFUBQsgBu2w50e6LM6zsEsI wbiw== X-Gm-Message-State: AIkVDXL5TSm8iGjqQn0AoS24hUyCC3UNm2wZ5Xsoo7/Bh4ZyW2877wTPt2ymEd+rrKpfIIe3JUrfWOj/WVMbqg== X-Received: by 10.13.208.198 with SMTP id s189mr8178902ywd.315.1484167563686; Wed, 11 Jan 2017 12:46:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.80.215 with HTTP; Wed, 11 Jan 2017 12:46:02 -0800 (PST) In-Reply-To: References: Date: Wed, 11 Jan 2017 21:46:02 +0100 Message-ID: To: Dmitry Stogov Cc: PHP internals list , Bob Weinand , Joe Watkins , Zeev Suraski , "Anatol Belski (ab@php.net)" , Nikita Popov , Xinchen Hui Content-Type: multipart/alternative; boundary=001a114d76f46bd9e50545d7b0e6 Subject: Re: Change in type-hint representation From: nikita.ppv@gmail.com (Nikita Popov) --001a114d76f46bd9e50545d7b0e6 Content-Type: text/plain; charset=UTF-8 On Wed, Jan 11, 2017 at 1:07 PM, Dmitry Stogov wrote: > Hi, > > > I propose to introduce a unified type representation (zend_type). > > Now it's going to be used for typing of arguments and return values. > > Later we should use it for properties and other things. > > > https://gist.github.com/dstogov/1b25079856afccf0d69f77d499cb0ab1 > > > The main changes are in zend_types.h and zend_compile.h, the rest is just > an adoption for new type representation. > > I don't think we need RFC, because this is just an internal change that > doesn't change behavior. > > > I got the idea working on typed properties together with Bob and Joe. > > https://github.com/php/php-src/compare/master...bwoebi: > typed_ref_properties > > I think it would be better to introduce zend_type and then continue work > on typed properties. > > > Any comments? > > > Thanks. Dmitry. > I like this. Two questions: 1. Can you please clarify what ZEND_TYPE_ENCODE_CLASS_CONST_* is for? Why does this not use the usual encoding for allow_null? Does the compiler not allow casts in initializers or something? 2. Is the use of zend_strings in arginfo of internal functions zts safe? I.e. does the function registration happen per-thread or do we reuse registered functions across threads? If that's the case we might run into issues with non-atomic RCs. Nikita --001a114d76f46bd9e50545d7b0e6--