Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83812 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4990 invoked from network); 25 Feb 2015 17:55:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Feb 2015 17:55:57 -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.220.176 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.176 mail-vc0-f176.google.com Received: from [209.85.220.176] ([209.85.220.176:55756] helo=mail-vc0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 60/13-20665-CAC0EE45 for ; Wed, 25 Feb 2015 12:55:57 -0500 Received: by mail-vc0-f176.google.com with SMTP id la4so1940754vcb.7 for ; Wed, 25 Feb 2015 09:55:53 -0800 (PST) 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=mVYfY3og2uQjzQ/W06UG2qVPW12V05RvlFXL4tsRWJc=; b=esQ1Cso+iUjETiIkqUerHOGLbC9bA3TmnI+U8Q9hD4R9q6WNBFwh18u5hIrGK2F30W 86rNc46ZUHDjCyy6cdxKm2YKJ1RHB+WvQTxYCybGsn874HwFDJWkue+xaBHfmJK8wrXl +ZEvmA/cdJLe5tzKkzXAEsalKXP9wH3mOKsA3zeLnHXww1Wsva/lSDvVq3Mq+zs/OQZz /iYo56RPdnr7y+1OjyTcPs5fBeGKqfZaJx6SqPfgLM8EmbnI9M2F8UTidxdUuH7yIcg3 WNL6CI7pU/BXquJgytEw9Kc4461aaJdI/9T+DKtetDU9RvuswwaCdXnRb+5BnlTr2HPq y4mQ== X-Gm-Message-State: ALoCoQnWrX+nXzSSuHC6Sn4R/i22H/rXc45dlJ1INLMwNuxs1TOPme/FQF+D1DYjjhxF7Kg2mdXt/05fYICj+gPBFi1AfRZhFhzjEiGawFkOCLWsAFcXjdPVUHNDRS+k98SvqGDUC4EH9zcAoSE4WpiqzpHWZJOHog== MIME-Version: 1.0 X-Received: by 10.52.72.5 with SMTP id z5mr5077987vdu.78.1424886953723; Wed, 25 Feb 2015 09:55:53 -0800 (PST) Received: by 10.52.113.231 with HTTP; Wed, 25 Feb 2015 09:55:53 -0800 (PST) In-Reply-To: References: Date: Wed, 25 Feb 2015 21:55:53 +0400 Message-ID: To: Anthony Ferrara Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=20cf307d0138b8deef050fed58cb Subject: Re: [PHP-DEV] Re: [RFC-Discuss] Scalar Type Declarations v0.5 From: dmitry@zend.com (Dmitry Stogov) --20cf307d0138b8deef050fed58cb Content-Type: text/plain; charset=UTF-8 On Wed, Feb 25, 2015 at 7:06 PM, Anthony Ferrara wrote: > Dmitry, > > > But checks are performed not in the caller but in RECV opcode at called > > function. > > And in this function we don't know id it's going to be called only in > strict > > mode or in weak as well. > > Currently, yes. However, by the time we enter ZEND_DO_FCALL, we know > which function we're going to call. And at compile time, we know how > many arguments exist. > > We can also move the argument verification from RECV into > ZEND_DO_FCALL just like happens today with internal functions. In > fact, it may be worthwhile investigating that in general. > ZEND_DO_FCALL is a bad place. You'll have to traverse arguments and arg_infos one more time. It may make sense to add checks into ZEND_SEND_... opcodes. This should be the cheapest option, however I'm not sure what kind of impact and side effects it will make. Also, even if we move checks into ZEND_SEND_..., we will have to keep checks in ZEND_RECV anyway (for missing arguments). This is not a big problem, because we will able to unconditionally skip first RECV opocdes for passed arguments. Thanks. Dmitry. > > Anthony > --20cf307d0138b8deef050fed58cb--