Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97715 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69747 invoked from network); 12 Jan 2017 08:07:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jan 2017 08:07:14 -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 104.47.33.137 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 104.47.33.137 mail-bn3nam01on0137.outbound.protection.outlook.com Received: from [104.47.33.137] ([104.47.33.137:3746] helo=NAM01-BN3-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 28/61-50165-E2937785 for ; Thu, 12 Jan 2017 03:07:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=OXcLRzkLQ0Feo7ANevfxC22dgwJFDCZF098aFnfQ2BM=; b=B9L1Kh8HVEiYmNFDPmKFg+onR6/BHttTtFUBViSuy8rHGtZQ6VxOCxP01Jov0Woo8ycXXMs1DBiNfa8eLKmibDPwwEp/2s+6uzPh36Rm3VCE2w95xRwnUCh90xeua9B14z5GgxbjpqxPSS7vwAakomsv/VtSJATPcvhKupmkUaQ= Received: from MWHPR02MB2477.namprd02.prod.outlook.com (10.168.204.147) by MWHPR02MB2480.namprd02.prod.outlook.com (10.168.204.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7; Thu, 12 Jan 2017 08:07:03 +0000 Received: from MWHPR02MB2477.namprd02.prod.outlook.com ([10.168.204.147]) by MWHPR02MB2477.namprd02.prod.outlook.com ([10.168.204.147]) with mapi id 15.01.0829.017; Thu, 12 Jan 2017 08:07:02 +0000 To: Nikita Popov CC: Dmitry Stogov , Xinchen Hui , Zeev Suraski , Nikita Popov , Joe Watkins , "Anatol Belski (ab@php.net)" , "Bob Weinand" , PHP internals list Thread-Topic: Change in type-hint representation Thread-Index: AQHSbKo5JH94e0ZZMkmDI5OUmOzW+w== Date: Thu, 12 Jan 2017 08:07:02 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=dmitry@zend.com; x-originating-ip: [213.21.45.232] x-microsoft-exchange-diagnostics: 1;MWHPR02MB2480;7:hHSFyY08dLY178WXSg9BhjEVMsiZ1mhndsqwKOSP2aFB6Vbf0XNK3oGlfwYPeI7PNKFHKfK9/T/QWYD8oTDds9FWv0BzB0SwDxbN22GopqQVQ7f3qQzOe3M/ODykUbwCS2xgpLE2chCrKdA4MAMr75XhJ0ldGgj6KZwsmIWAfK/xhicsc6AURLidU40sspCdP/zZkM02u7CdxScW38WkkLROPaHL7eioNG3iJAuCZnFITuAUAo3VSnmDg/JEEhx4fNFOYNrVZ0o9D1LvpUk2H0iNyPD5BzwpuiJmBl1KUyuSQ/Tz3hSXFNi2Lsz63xPDLsQqvz/Sw/JU/bds5V72g+3nkWp5M8WkcUh/AQliRGPJ5t0oKYwGYJnpyEKvIukJhRFIYulR/6WC1xYFGv/ZqrQGjE39PjSESZHZdlV+MdJcwXCegovlEcfzRCdwAkgOSd30e5MM7LlI97dvus+L7w== x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10019020)(7916002)(39450400003)(189002)(24454002)(377454003)(199003)(33656002)(54906002)(25786008)(38730400001)(9686003)(110136003)(6306002)(54896002)(2900100001)(39060400001)(55016002)(5660300001)(106356001)(7696004)(105586002)(92566002)(97736004)(236005)(6436002)(77096006)(6506006)(50986999)(54356999)(106116001)(606005)(189998001)(86362001)(66066001)(99286003)(575784001)(8676002)(101416001)(305945005)(229853002)(7736002)(74316002)(6916009)(122556002)(2906002)(3660700001)(102836003)(6116002)(3846002)(3280700002)(3480700004)(81166006)(81156014)(8936002)(68736007)(7906003)(4326007);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR02MB2480;H:MWHPR02MB2477.namprd02.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-ms-office365-filtering-correlation-id: efa1db33-fd5a-4a72-0dcb-08d43ac1fd96 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR02MB2480; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(166708455590820)(192278398808882); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(6072148);SRVR:MWHPR02MB2480;BCL:0;PCL:0;RULEID:;SRVR:MWHPR02MB2480; x-forefront-prvs: 018577E36E received-spf: None (protection.outlook.com: zend.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_MWHPR02MB247770A47BC24225D317D159BF790MWHPR02MB2477namp_" MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jan 2017 08:07:02.1689 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2480 Subject: Re: Change in type-hint representation From: dmitry@zend.com (Dmitry Stogov) --_000_MWHPR02MB247770A47BC24225D317D159BF790MWHPR02MB2477namp_ Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable On Jan 11, 2017 11:46 PM, Nikita Popov wrote: 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 a= n adoption for new type representation. I don't think we need RFC, because this is just an internal change that doe= sn'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 d= oes this not use the usual encoding for allow_null? Does the compiler not a= llow casts in initializers or something? They are used for constant initializers. Compiler doesn't allow operations = with addresses of constant strings, because they are assigned only by ld. 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 register= ed functions across threads? If that's the case we might run into issues wi= th non-atomic RCs. Good point. I'll check this. Thanks. Dmitry. Nikita --_000_MWHPR02MB247770A47BC24225D317D159BF790MWHPR02MB2477namp_--