Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102634 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45247 invoked from network); 7 Jul 2018 11:14:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Jul 2018 11:14:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=andreas@dqxtech.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=andreas@dqxtech.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain dqxtech.net from 209.85.218.65 cause and error) X-PHP-List-Original-Sender: andreas@dqxtech.net X-Host-Fingerprint: 209.85.218.65 mail-oi0-f65.google.com Received: from [209.85.218.65] ([209.85.218.65:34542] helo=mail-oi0-f65.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E5/32-55607-380A04B5 for ; Sat, 07 Jul 2018 07:14:11 -0400 Received: by mail-oi0-f65.google.com with SMTP id 13-v6so28100703ois.1 for ; Sat, 07 Jul 2018 04:14:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dqxtech-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=p9Ib90HUU8fwgu63z7zhzaQOeeO6g+vNvYYDu3bRdvE=; b=YddByo/Yhf/23v1hSXaMoQWSDOPag8rN+ndqZuEyX2iDn2+x2bpUh7DXtZFld8L5Hs n1+FHoPGe6sA5f99yg4+MT7JMKQziTsi8xVaKl6ODtT1tOdu1v3BNn7EqskQ2WvgvePQ WlghE5SkGTVJc2E1WT6tSsPYlMxFeWraxZ5WEbHnexYUBeXHhGoCNOrEBQltGy1/MnLI 23IjJ6Il7VWM4VyY4kNABLgBcpjNjpQ/SPDC4Q2MA2+CXFDdghoHXS0smPk3GjSSQ2/X 7PECAE/Of6WPbjTBRMJtQkbkoGYxdKNzX6fRhDyHd1KHuOaG/K5Scc74ZYeYOEaNaRjM q0kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=p9Ib90HUU8fwgu63z7zhzaQOeeO6g+vNvYYDu3bRdvE=; b=gbBZoDb+pl2AHq+eFAywsul1ANC30QubWJ0WZjHeOSbI4j0B6MTVbr4OplvnPVbGG4 y13pxdrlM9BFHFBkNrLbKqz7KYdEaI3zCjCwMdarffw/RlZkja4ivSQqDGwyP84q2APL cudFZUVHprydbf8u9ZTaJ79OdWbfwIOuQDi2bJTBkf2Y/1VvZ7VXh73Ns3qNZq9ddypR 6aZdhRhx1nZNeYFyAJ+JjZciLT8KMvCvwFpXqya7Iu1UP+VgU4eJRRyEDpl138dY/MUB aZVLQB3FeG6zPkIQdfsTKSIsoVoE5UmirQdj8orRPKEYyt00XOx/zM7IULeX8Kq/4Ak8 oFNQ== X-Gm-Message-State: APt69E0Cj8ToFeSfRSxdO7mtbXop5ItYx5hmY2RlY1niFr7hlPyQ/HK4 1z9ISYVhJUtGUd6rDZUqIBMae4N5 X-Google-Smtp-Source: AAOMgpeqnnJBvBhJqZoxDpnTHKx3VVnA917DyKtvSiGGCmCO6tZWCvTgTBe3Kb11Skd2pa8M8eBi4Q== X-Received: by 2002:aca:90d:: with SMTP id 13-v6mr16191368oij.300.1530962048392; Sat, 07 Jul 2018 04:14:08 -0700 (PDT) Received: from mail-oi0-f42.google.com (mail-oi0-f42.google.com. [209.85.218.42]) by smtp.googlemail.com with ESMTPSA id q204-v6sm6356442oif.55.2018.07.07.04.14.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Jul 2018 04:14:07 -0700 (PDT) Received: by mail-oi0-f42.google.com with SMTP id k81-v6so28093833oib.4 for ; Sat, 07 Jul 2018 04:14:07 -0700 (PDT) X-Received: by 2002:aca:c601:: with SMTP id w1-v6mr16232714oif.27.1530962047337; Sat, 07 Jul 2018 04:14:07 -0700 (PDT) MIME-Version: 1.0 References: <04.57.38004.22D38C85@pb1.pair.com> <5ee4eec2-4910-552a-a3ad-248645fbe037@gmx.de> In-Reply-To: <5ee4eec2-4910-552a-a3ad-248645fbe037@gmx.de> Date: Sat, 7 Jul 2018 12:13:56 +0100 X-Gmail-Original-Message-ID: Message-ID: To: "Christoph M. Becker" Cc: ajf@ajf.me, PHP internals Content-Type: multipart/alternative; boundary="000000000000ff0b24057066e060" Subject: Re: [PHP-DEV] Re: [PATCH] Make var_export() output "(object)array(..." instead of"stdClass::__set_state(..." for stdClass From: andreas@dqxtech.net (Andreas Hennings) --000000000000ff0b24057066e060 Content-Type: text/plain; charset="UTF-8" I do not disagree, just want to make an observation. If multiple properties or array keys reference the same instance of \stdClass, there will be multiple instances with identical values after a round-trip with var_export() + eval(). This is not necessarily a problem, just something to be aware of. On Wed, 4 Jul 2018 at 22:33, 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 . > > -- > Christoph M. Becker > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --000000000000ff0b24057066e060--