Re: com php-src: Fix spl_directory cast_object, reenable error: Zend/zend_execute.h ext/spl/spl_directory.c
| From: | Dmitry Stogov | Date: | Mon, 12 May 2014 20:01:04 +0000 |
| Subject: | Re: com php-src: Fix spl_directory cast_object, reenable error: Zend/zend_execute.h ext/spl/spl_directory.c | ||
| References: | 1 2 3 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-78294@lists.php.net to get a copy of this message | ||
got it. but it mean that any internal class might need be changed to avoid
this warning.
May be you can think about a better place for this warning?
Thanks. Dmitry.
On Mon, May 12, 2014 at 11:45 PM, Nikita Popov <nikita.ppv@gmail.com> wrote:
> On Mon, May 12, 2014 at 9:37 PM, Dmitry Stogov <dmitry@zend.com> wrote:
>
>> Hi Nikita,
>>
>> why do we need this new error message?
>>
>> Thanks. Dmitry.
>>
>
> Because all our casting code is duplicated somewhere between 2 and 4
> times, usually with slightly different behavior. So if some code was
> switched from using convert_to_boolean (which had this error beforehand) to
> using zend_is_true (which didn't have this error) the behavior changes
> (even though they should be behaviorally identical). To make them
> consistent I could either remove the error from convert_to_boolean or add
> it to zend_is_true - given that we use this error for all other casts as
> well, I figured it's better to add it to zend_is_true.
>
> The issue with spl_directory was that it overrides the cast_object
> handler, but doesn't implement it in a way that is compatible with our
> standard cast handler - namely to always return true for a boolean cast.
>
> Nikita
>