Re: [PHP-DEV] [PATCH] Make var_export() output "(object)array(..."instead of "stdClass::__set_state(..." for stdClass

2017-03-15 Thread Andrea Faulds
Hi Marc, Marc Bennewitz wrote: Personally I would like to have a more reasonable way in general. No special case and no magic method. So my proposal then would be to try to add a class cast operator (needs an own RFC) and later to with this approach on var_export. I've wondered if this would

Re: [PHP-DEV] [PATCH] Make var_export() output "(object)array(..." instead of "stdClass::__set_state(..." for stdClass

2017-03-14 Thread Stanislav Malyshev
Hi! > Additionally I feel that adding methods to stdClass will muddy the waters > -- for example, this means that extending stdClass is no longer entirely > unreasonable, as you might want to do it to reuse the __set_state() > implementation. Not something I want to see happening. I'm afraid that

Re: [PHP-DEV] [PATCH] Make var_export() output "(object)array(..." instead of "stdClass::__set_state(..." for stdClass

2017-03-14 Thread Nikita Popov
On Tue, Mar 14, 2017 at 11:20 PM, Derick Rethans wrote: > On Tue, 14 Mar 2017, Andrea Faulds wrote: > > > Hi everyone, > > > > Since stdClass has no __set_state method, var_export() produces unusable > > output if given an object of that class. I wrote a patch that would make > > var_export() pro

Re: [PHP-DEV] [PATCH] Make var_export() output "(object)array(..." instead of "stdClass::__set_state(..." for stdClass

2017-03-14 Thread Derick Rethans
On Tue, 14 Mar 2017, Andrea Faulds wrote: > Hi everyone, > > Since stdClass has no __set_state method, var_export() produces unusable > output if given an object of that class. I wrote a patch that would make > var_export() produce a cast to object instead, which could be evaluated to get > back

Re: [PHP-DEV] [PATCH] Make var_export() output "(object)array(..." instead of "stdClass::__set_state(..." for stdClass

2017-03-14 Thread Marc Bennewitz
Am 14.03.2017 um 20:26 schrieb Fleshgrinder: On 3/14/2017 7:57 PM, Andrea Faulds wrote: Hi everyone, Since stdClass has no __set_state method, var_export() produces unusable output if given an object of that class. I wrote a patch that would make var_export() produce a cast to object instead,

Re: [PHP-DEV] [PATCH] Make var_export() output "(object)array(..." instead of "stdClass::__set_state(..." for stdClass

2017-03-14 Thread Fleshgrinder
On 3/14/2017 7:57 PM, Andrea Faulds wrote: > Hi everyone, > > Since stdClass has no __set_state method, var_export() produces unusable > output if given an object of that class. I wrote a patch that would make > var_export() produce a cast to object instead, which could be evaluated > to get back

[PHP-DEV] [PATCH] Make var_export() output "(object)array(..." instead of "stdClass::__set_state(..." for stdClass

2017-03-14 Thread Andrea Faulds
Hi everyone, Since stdClass has no __set_state method, var_export() produces unusable output if given an object of that class. I wrote a patch that would make var_export() produce a cast to object instead, which could be evaluated to get back a stdClass: https://github.com/php/php-src/pull/2