Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86800 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79708 invoked from network); 22 Jun 2015 23:54:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jun 2015 23:54:32 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.182 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.182 mail-pd0-f182.google.com Received: from [209.85.192.182] ([209.85.192.182:35510] helo=mail-pd0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 85/1A-07834-730A8855 for ; Mon, 22 Jun 2015 19:54:32 -0400 Received: by pdbci14 with SMTP id ci14so89817391pdb.2 for ; Mon, 22 Jun 2015 16:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=bxsAbYS1Es6xGp/HSdVtjMiWJfgBAbvFZJTTn5gT7tY=; b=f+an42imDF1iThPQCRYgpIOYYvcbg7iJOvNZXwUbQ4DkJJxsYQ1OC0qb5V2Y5JHofx DJIHS0jNqaiXQ3AolRxvCN1v+gEOXCVMhFygZ7DLpzXRnp2OV7/ixDa38aZqvSkkrySV QrriWSmrKjlVN6NWpPgwtkx23s+Jc0ANRMei6T2y6P4qG9BziHOX3xDvvVMK/K3r1JXv InneWPjJUqD2h/3Mgj5vVRk2cIbbV/Jmrvc8XByKSnk9lkWseao/j+oQGhmbsN1aQD27 +kk5lpCyQg2dwUHU6JtZrhO6+065uHUvn1+MLUt//LN963B1Ajy3jWJAHaZFfBQKq/M4 0JxQ== X-Received: by 10.68.191.229 with SMTP id hb5mr63375430pbc.126.1435017268151; Mon, 22 Jun 2015 16:54:28 -0700 (PDT) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id ve1sm21005314pbc.52.2015.06.22.16.54.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jun 2015 16:54:27 -0700 (PDT) Message-ID: <5588A02C.4040602@gmail.com> Date: Mon, 22 Jun 2015 16:54:20 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Dmitry Stogov , Rasmus Lerdorf CC: Bob Weinand , Anatol Belski , Kalle Sommer Nielsen , Nikita Popov , PHP internals References: <5586E5D1.4010901@lerdorf.com> <55870947.4060304@lerdorf.com> <5587334C.2080401@lerdorf.com> <55873676.6050706@gmail.com> <55876B29.90804@lerdorf.com> <55881A72.4090403@lerdorf.com> <5588477E.7050109@lerdorf.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] hasType() for internal function parameters? From: smalyshev@gmail.com (Stanislav Malyshev) Hi! So I tried to remove the checks for ZEND_ACC_HAS_TYPE_HINTS: https://github.com/php/php-src/pull/1354 Turns out there is a lot of tests that assume function with wrong arguments throws Error, but ZPP and type checks work differently - ZPP first checks argument number (and doesn't throw if number is wrong but instead creates warning), while type checks (that shouldn't really happen on internals but do) check types first and not check argument number. So I wonder which way is the best to proceed here. Looks like this comes from 5.6 where internal function types were verified in executor: https://github.com/php/php-src/blob/PHP-5.6/Zend/zend_vm_def.h#L1974 I'm not sure what to do with it - on one side, I think ZPP should handle it for internal functions, otherwise we're doing the same work twice. On the other side, that would be pretty substantial, even if maybe correct, BC break. Should we keep the ZEND_ACC_HAS_TYPE_HINTS type checks and accept the fact that this way we're checking everything twice, or should be clean it up? -- Stas Malyshev smalyshev@gmail.com