Re: com php-src: Fix spl_directory cast_object, reenable error: Zend/zend_execute.h ext/spl/spl_directory.c
| From: | Nikita Popov | Date: | Mon, 12 May 2014 19:45:55 +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 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-78292@lists.php.net to get a copy of this message | ||
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