Re: Re: __set_state (Was: Re: [PHP-DEV] [RFC] __debug_info())
| From: | Rowan Collins | Date: | Wed, 05 Feb 2014 19:36:43 +0000 |
| Subject: | Re: Re: __set_state (Was: Re: [PHP-DEV] [RFC] __debug_info()) | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-72287@lists.php.net to get a copy of this message | ||
Yasuo Ohgaki wrote (on 23/01/2014):
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? -- Rowan Collins [IMSoP]You seem to misunderstand what __set_state() is for. It is for reliablyrepresenting 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.