Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103086 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73862 invoked from network); 12 Aug 2018 16:43:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Aug 2018 16:43:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.220.195 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.220.195 mail-qk0-f195.google.com Received: from [209.85.220.195] ([209.85.220.195:45062] helo=mail-qk0-f195.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 49/D5-32660-C93607B5 for ; Sun, 12 Aug 2018 12:43:09 -0400 Received: by mail-qk0-f195.google.com with SMTP id c192-v6so9482628qkg.12 for ; Sun, 12 Aug 2018 09:43:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=tLtE9Cqjno3qgxhPErrZEDVBHgl2movf1VjlLCQcqX0=; b=Gh+bO0eVvJttefsc/oCMywr6wQwK4yMoz9X0C9Gj6W+EX2ZqvVwBKacMEdKx+z75Qw qsns3dPsea+kIy2bKW97jMvlixw9p07A093w4ubZzYnorulJjW7n171kK5sZ5lJUuQ+4 SHFDtzP2LPYmJc7Soj8eVcGHRfOWzrr3qEEsiZGCICNJtBOjrK0oJ4gWuqmVIQh902IA zwVWkcURSil0Ppzmsc17Ca4onGTjI/X+opeSUqO2cTOZY64psGSTvFEC7LQL5w6YKpZt qABlkR0PhxpUuk8MbVJXEHprblS+gseGhJSFIcdfCLqF0gQGMon8k99IO9o73ikvDLz2 Zuew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=tLtE9Cqjno3qgxhPErrZEDVBHgl2movf1VjlLCQcqX0=; b=FwYdEPQHFX6hCRUJAwPJYjyUjy5x9fbbIIL6ClgKJ4IUQs1rO9j8yOhktyBqQtMSV3 IdP1eG1J8WVOb4+6CK7WOiikiixcD4vZgPLYxn92GGnj8pYkSMEEcROV8R80Z0OGCxPC Jze9DVBN1xCKAkxNoAPkNaBUzS25z3x0rfDV7gMHmUWhS8Sn9zsfCk/RdEvzpCQzbNKU mxhnNg6iSrHFoniB5VvFQJ41A72DRC3E2u0MTXaS5dvEErTMpw0j3VunWm467q53Hm/z Ic5FUElA+k4cvREu/9PcKmnoIecvGTxmyCof1kzubN5PghOsU0gtPieNgbNeRnQ8Qt52 njpQ== X-Gm-Message-State: AOUpUlGHQevT6K2UVTgw7AGYwXb+GiUL/4rvozz9eSQeAOfNeureuMcG P2ty5q7fVDA6msWRuCF0HMvlyN1IMCRmmAtt7vjb9KFcsSc= X-Google-Smtp-Source: AA+uWPw2XAhLxsjPpYoHqP1VgZs4DTls2WbYW27tMS7OTSvfINY6Q6r5kV9qECWCAF1GeYZk36n2UfCV8zQ8X9XsGDM= X-Received: by 2002:a37:9e17:: with SMTP id h23-v6mr12348427qke.269.1534092185759; Sun, 12 Aug 2018 09:43:05 -0700 (PDT) MIME-Version: 1.0 Sender: php@golemon.com Received: by 2002:a0c:ada6:0:0:0:0:0 with HTTP; Sun, 12 Aug 2018 09:43:05 -0700 (PDT) X-Originating-IP: [98.213.160.75] In-Reply-To: References: <03a9b282-1a46-c2a6-6987-0f2778f99be4@gmx.de> Date: Sun, 12 Aug 2018 11:43:05 -0500 X-Google-Sender-Auth: ibHDmBfoNmucz2fomrFs6Nn-NeA Message-ID: To: Stanislav Malyshev Cc: "Christoph M. Becker" , PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Re: The curious case of the comparable objects. From: pollita@php.net (Sara Golemon) On Sun, Aug 12, 2018 at 12:47 AM, Stanislav Malyshev wrote: > Undefined behavior is undefined :) > (Ignoring your followup for a moment) Even for undefined behavior, we should *try* to make the behavior repeatable. I know we wouldn't need to, but we should always go for least surprise. It's the side-effect hiding in the array cast from print_r/var_dump or certain other presumable "read-only" actions causing the interpretation of of the object compare that's maximum surprise. >> > > So looks like this part of the spec is violated, and I stand corrected - > it's actually defined in this case, and should be fixed to follow the > spec. I still think it makes little sense, but we have the spec, so we > have to follow the spec. > > In this case, it's ok to fix it in all active versions - the spec wins I > think. Or, we have to change the spec :) > Personally, I vote for fix on active branches, but it's not an urgent bug, so I'll give some more time for feedback before pushing the PR below. > Depends on what the "fix" is, I assume. > I went with https://github.com/php/php-src/pull/3434 which has the same overall complexity, though several more operations per element so it'll be nominally less performant. Alternate implementations welcome. -Sara