Re: Re: __set_state (Was: Re: [PHP-DEV] [RFC] __debug_info())
| From: | Yasuo Ohgaki | Date: | Wed, 05 Feb 2014 22:10:32 +0000 |
| Subject: | Re: Re: __set_state (Was: Re: [PHP-DEV] [RFC] __debug_info()) | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-72300@lists.php.net to get a copy of this message | ||
Hi Rowan,
On Thu, Feb 6, 2014 at 4:36 AM, Rowan Collins <rowan.collins@gmail.com>wrote:
>
> You seem to misunderstand what __set_state() is for. It is for reliably
>>> >representing a value so that you can "include" it's contents with
>>> >var_export(). If 5.6 would suddenly start spitting out
>>> >Class::__setState() instead of Classs::__set_state() then older PHP
>>> >versions can't parse/include that outputted data anymore.
>>> >
>>>
>> I have to check code, but don't we have options for this?
>> We may use __set_state() for var_export and still have alias as
>> __setState.
>> People are using var_export exchange PHP data, so we should be careful.
>> I agree this.
>>
>
> Is there a use case for __set_state *other than* var_export()?
>
> In other words, if not var_export(), what code would ever include a
> reference to __setState() if it were added as an alias?
My bad.
var_export() does not specify method, so it can alias safely.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net