Also forwarding to the list.

On 20.11.2018 at 11:50, Nikita Popov wrote:

> On Tue, Nov 20, 2018 at 11:44 AM Christoph M. Becker <[email protected]>
> wrote:
> 
>> With regard to bug #77177[1], I'm wondering whether a get_properties
>> handler[2] is allowed to return NULL, or whether an empty hash table has
>> to be returned instead.
>>
>> [1] <https://bugs.php.net/bug.php?id=77177>
>> [2] 
>> <https://github.com/php/php-src/blob/php-7.3.0RC5/Zend/zend_object_handlers.h#L91-L92>
> 
> It's currently considered legal, but I would like to move towards not
> allowing it (I've already tightened up requirements for many other object
> handlers in master). A NULL return value from get_properties can be
> replaced by a return of &zend_empty_array, which saves all the consuming
> code from having to perform unnecessary null checks. I would recommend
> changing that code to return &zend_empty_array, rather than make
> serialization check NULL.
> 
> Additionally, COM should really be setting the
> serialize_deny/unserialize_deny handlers, to explicitly prohibit
> serialization, rather than just return a garbage value.

Thanks, Nikita!  I've just opened
<https://github.com/php/php-src/pull/3672>.

-- 
Christoph M. Becker

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to