On Wed, Feb 25, 2015 at 7:06 PM, Anthony Ferrara <ircmax...@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 >