Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102787 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11416 invoked from network); 12 Jul 2018 11:46:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jul 2018 11:46:33 -0000 X-Host-Fingerprint: 85.230.241.5 c-05f1e655.79-4-64736c10.bbcust.telenor.se Received: from [85.230.241.5] ([85.230.241.5:15558] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AC/46-57182-49F374B5 for ; Thu, 12 Jul 2018 07:46:28 -0400 Message-ID: To: internals@lists.php.net References: <04.57.38004.22D38C85@pb1.pair.com> <5ee4eec2-4910-552a-a3ad-248645fbe037@gmx.de> Date: Thu, 12 Jul 2018 13:46:26 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46 MIME-Version: 1.0 In-Reply-To: <5ee4eec2-4910-552a-a3ad-248645fbe037@gmx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 85.230.241.5 Subject: Re: [PATCH] Make var_export() output "(object)array(..." insteadof"stdClass::__set_state(..." for stdClass From: ajf@ajf.me (Andrea Faulds) Christoph M. Becker wrote: > On 14.03.2017 at 19:57, Andrea Faulds wrote: > >> 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/2420 >> >> Any thoughts/comments? >> >> If you're wondering about whether a __set_state method should be added >> to stdClass, I posted some thoughts in the pull request discussion already. > > FTR: If nobody objects, I'll merge this PR into master on 2018-07-12, so > that it goes into PHP 7.3. > > See . > And so it was done: https://github.com/php/php-src/commit/e4e9cd835550990a6b8df7c61d59b6cc0da9b5b2 Thanks, Cristoph! :) -- Andrea Faulds https://ajf.me/