Re: Re: [RFC-Discuss] Scalar Type Declarations v0.5
| From: | Dmitry Stogov | Date: | Wed, 25 Feb 2015 17:55:53 +0000 |
| Subject: | Re: Re: [RFC-Discuss] Scalar Type Declarations v0.5 | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-83812@lists.php.net to get a copy of this message | ||
On Wed, Feb 25, 2015 at 7:06 PM, Anthony Ferrara <ircmaxell@gmail.com>
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
>