[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-internals
Subject:    Re: [PHP-DEV] Return value of get_properties handler
From:       "Christoph M. Becker" <cmbecker69 () gmx ! de>
Date:       2018-11-20 23:33:41
Message-ID: f1e113cd-8a0d-d30d-db02-63bd342bb393 () gmx ! de
[Download RAW message or body]

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 <cmbecker69@gmx.de>
> 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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic