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

From: Date: Wed, 15 Mar 2017 15:51:56 +0000
Subject: Re: [PATCH] Make var_export() output "(object)array(..."instead of "stdClass::__set_state(..." for stdClass
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-98538@lists.php.net to get a copy of this message
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 make sense before myself. But I think any such mechanism would need explicit support from the class being casted to, if the resulting internal object state is to make sense. stdClass wouldn't have that support. Thanks. -- Andrea Faulds https://ajf.me/

« previous php.internals (#98538) next »