Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98538 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53561 invoked from network); 15 Mar 2017 15:52:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Mar 2017 15:52:01 -0000 X-Host-Fingerprint: 95.148.67.80 unknown Received: from [95.148.67.80] ([95.148.67.80:3909] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 88/6F-38004-02369C85 for ; Wed, 15 Mar 2017 10:52:00 -0500 Message-ID: <88.6F.38004.02369C85@pb1.pair.com> To: internals@lists.php.net References: <04.57.38004.22D38C85@pb1.pair.com> <156faa4f-b159-031d-23a2-7367f692dce0@mabe.berlin> Date: Wed, 15 Mar 2017 15:51:56 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46 MIME-Version: 1.0 In-Reply-To: <156faa4f-b159-031d-23a2-7367f692dce0@mabe.berlin> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 95.148.67.80 Subject: Re: [PHP-DEV] [PATCH] Make var_export() output "(object)array(..."instead of "stdClass::__set_state(..." for stdClass From: ajf@ajf.me (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 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/