Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116275 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 38861 invoked from network); 13 Oct 2021 21:08:14 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Oct 2021 21:08:14 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 847741804A7 for ; Wed, 13 Oct 2021 14:54:48 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com [209.85.219.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 13 Oct 2021 14:54:48 -0700 (PDT) Received: by mail-yb1-f174.google.com with SMTP id i84so9797940ybc.12 for ; Wed, 13 Oct 2021 14:54:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hGvOjMQzYvlfn2C+nRSKVvlW7FX1J1DP/LD2pfrjk6E=; b=Y03b0aKrut2/7Gb51C6wI3fn6SFGjHdmbG0pGpluRLiFFYg3KOoyZbkFu71OEjltkU QI9IqEm75ZN2G9CmYNpicyWJHCH5vUJovGhVdSwlCVWz5pNsVmWZz1ZM07kt2n6V11bZ P4RVEPIdiicN4kGPzEKjuC4xaFl8S5ZcdYDxPkWD8EGVLQP88CDb+XoS/+Dq2QTv5LUc qH+oTmvXld2/2TxRnzDcXraur1OWGapEBRHEII4CUM9DWm362taJGxtN3Ffh9EU/Ropj rWybXOyP+PCvnsnaPGqQlgucTQ0998goEz2TjyRImjnt3/zdR0bnvPvine8MfVuw5p0V T+nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hGvOjMQzYvlfn2C+nRSKVvlW7FX1J1DP/LD2pfrjk6E=; b=tyfrIuWZeqP5p6TZM1zhiZ62eC+RBZYxK/b12RUhbJLvcA7sjbiU7S8iT3Cb9KkhT8 e6TQ4+cH38N15bq8ep2u2sXVKG94zV/jdzsacG6hlRiFnTm0LDVZnJ2cwuRFxCdZwOhz D0nQ4MBqjt7jVpHz6meA/3IIf7MFz/bveZKo1UjrTA9OIG456uxQWHXkzygBwyxjPIB6 nOPvWpFxK80MsJNPPXDs7eirikZQdg0eHWJBHVOH2U/dgCk+HMOVlAeu0S2WEk1xQUSA w5C6pOiXbx5l/FnuKVHM09mD5xb5GXhEP9sIDlJ426ziWaiQeSfs7cWEHEPqt+g6UAes UZTw== X-Gm-Message-State: AOAM531ZcuaFRRAdUmeKOrMJn4k0j+xADbcpe93hsJh9QgtXhA9PqIfW 9+xyqIKtw++D8IxGgcy1Eir/tQuFd5zxsR7Q040= X-Google-Smtp-Source: ABdhPJyp3KutdBz0w3BMrlQK35JTzz/LCRO64xtUNAs+49jgW3ymYiUqALoyZEcHwlSDomgN8Pne+twANFGfQdL1D6Y= X-Received: by 2002:a5b:d05:: with SMTP id y5mr2027704ybp.123.1634162085363; Wed, 13 Oct 2021 14:54:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 13 Oct 2021 22:54:34 +0100 Message-ID: To: Benjamin Morel Cc: PHP Internals Content-Type: multipart/alternative; boundary="0000000000009a84ef05ce43022b" Subject: Re: [PHP-DEV] Order of properties in (array) cast on PHP 8.1 From: george.banyard@gmail.com ("G. P. B.") --0000000000009a84ef05ce43022b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 13 Oct 2021 at 22:45, Benjamin Morel wrote: > Hi internals, > > While running the test suite of one of my libs against PHP 8.1, I noticed > that the order in which properties are returned in an (array) cast has > changed. > > For example when casting an instance of this class to array: > > class A > { > private $x =3D 'x'; > } > > class B extends A > { > public $y; > public $z; > } > > On PHP 7.4-8.0, $x is returned last, while on PHP 8.1, it is returned > first. > > Demo: https://3v4l.org/FTMki > > It's not a big deal, but before I change my test suites, I wanted to doub= le > check here if this change was expected? > > Thanks in advance, > =E2=80=94 Benjamin > Yes, this change is expected and documented, see: https://www.php.net/manual/en/migration81.other-changes.php#migration81.oth= er-changes.functions.core Best regards, George P. Banyard --0000000000009a84ef05ce43022b--