Re: zend_parse_parameters() improvements

From: Date: Thu, 19 Jul 2012 23:22:38 +0000
Subject: Re: zend_parse_parameters() improvements
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Fri, Jul 20, 2012 at 12:20 AM, Sara Golemon <[email protected]> wrote:
> Okay, well... the main pieces of feedback I'd give on it then is to not
> change the behavior of the '!' modifier.  That's bad BC.
The behavior for pointer-params isn't changed. Only non-pointer params
will then accept the additional is_null argument.

> FWIW, there are a few examples of this being handled by defining the default
> value of the parameter to something non-sensical (such as a length of -1),
> then doing zpp with "|l!" would leave the default -1 alone when NULL is
> passed, and you can treat as "not passed".  Granted this is a bit of a hack
> and won't work for all situations.  Your approach is more comprehensive,
> just saying that for many cases it's not strictly needed.
If I'm not much mistaken this is not actually possible. NULL is
interpreted by PHP as a zero-y value. So the variable will be just set
to 0 and you have no way to discern a real 0 and NULL.

Nikita


Thread (26 messages)

« previous php.internals (#61527) next »