Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98521 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83206 invoked from network); 14 Mar 2017 18:57:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Mar 2017 18:57:41 -0000 X-Host-Fingerprint: 137.50.187.40 oa-edu-187-40.wireless.abdn.ac.uk Received: from [137.50.187.40] ([137.50.187.40:18348] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/57-38004-22D38C85 for ; Tue, 14 Mar 2017 13:57:39 -0500 Message-ID: <04.57.38004.22D38C85@pb1.pair.com> To: internals@lists.php.net X-Mozilla-News-Host: news://news.php.net:119 Date: Tue, 14 Mar 2017 18:57:34 +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 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 137.50.187.40 Subject: [PATCH] Make var_export() output "(object)array(..." instead of "stdClass::__set_state(..." for stdClass From: ajf@ajf.me (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/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. Thanks! -- Andrea Faulds https://ajf.me/