Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103090 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15212 invoked from network); 13 Aug 2018 08:24:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Aug 2018 08:24:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.196 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.223.196 mail-io0-f196.google.com Received: from [209.85.223.196] ([209.85.223.196:40996] helo=mail-io0-f196.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 49/69-32660-720417B5 for ; Mon, 13 Aug 2018 04:24:08 -0400 Received: by mail-io0-f196.google.com with SMTP id q4-v6so13921656iob.8 for ; Mon, 13 Aug 2018 01:24:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pVRo3FuY1c/095mpTzO7n3r3IUSgg7OlP/PEgA2sF+k=; b=Ob9Qf88NQiKil/Yn0t3nXqOHBupYXNRNPNid9wEYg3hd7xkszfbUM+eX+CNspTqIw6 rfR5OOuYg6PnjcLeHcAobEVQaWwcIsGN8UrQX+IxozPU1vr4Fz2Vl4bhwajufT+csOEg NpLIZFnXanucywali1yiMHWRINmCrpOhGdIZ2Qcq4xgpOn+LXJUExDtp+wAHVYotpiXD ujT56IHqCpdf4TqxXKynOevQb7QeMWQYQJ7pb4rDKa38fgriODQ7oIBF0GdkNLYh7qcD K/qMiL+pAgkU17Jf1p/sPnu1InX5lNFkgIYDnFO7HWYx67vgrMEGsSpC9Lk3+peLqPcB XjBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=pVRo3FuY1c/095mpTzO7n3r3IUSgg7OlP/PEgA2sF+k=; b=oSkn5Fbphqx0g0/ppqp3uM/hUu/iXn8RAMgsXriPjWiVyCQlac18el7+g3aurqOzbq 4hJATP1FXN+28qLodOlKT06SklvMIMY7lcF0/zJ593eT4tKyXMsQH4LbDH5Iiu1PJc/K 7LoC9UM5zX76wm5Q2VDxYxsspDWjqJkMGuKsUJ/Koz+wUlbVQy7BgFpk3Uk8KEzlhWcv xcpxcdn2tHecuGeGNrNDCxPVEk0xzxmMGriJvi3oEAMFetYTCqEQ+ub8KO0atfq1zuBr QIlR/qXVWZOtRumQhLziya9LMdmobb1COuuXrHtYR6TqL+o9gXH7jq+gEpMzigZ4v2xz J+9g== X-Gm-Message-State: AOUpUlFj2SWEjhjbggN8a7vydpz+6Fnx36CjlpwnCb+yIPthR/u+rlAu YhrXZQQEdfBH/2vzlCW3DUtyG7F7IMN9KOIhr2I= X-Google-Smtp-Source: AA+uWPwa3l8RYp8Vnio5qCenA2QmHF0f4gbdap1CtKwZCqDW6n9Wnggh2sBwRi3lHr4AUuA1rTsUnFxG/3l0e3PqyM0= X-Received: by 2002:a6b:c844:: with SMTP id y65-v6mr13809609iof.187.1534148644410; Mon, 13 Aug 2018 01:24:04 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:148a:0:0:0:0:0 with HTTP; Mon, 13 Aug 2018 01:24:03 -0700 (PDT) In-Reply-To: References: <03a9b282-1a46-c2a6-6987-0f2778f99be4@gmx.de> Date: Mon, 13 Aug 2018 10:24:03 +0200 Message-ID: To: Sara Golemon Cc: Stanislav Malyshev , "Christoph M. Becker" , PHP internals Content-Type: multipart/alternative; boundary="000000000000fb9a9c05734cd0e6" Subject: Re: [PHP-DEV] Re: The curious case of the comparable objects. From: nikita.ppv@gmail.com (Nikita Popov) --000000000000fb9a9c05734cd0e6 Content-Type: text/plain; charset="UTF-8" On Sun, Aug 12, 2018 at 6:43 PM, Sara Golemon wrote: > 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. > > >> expressions.md#user-content-relational-operators> > > > > 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. > I'd recommend against fixing active branches -- this is quite likely to break some tests using sort() somewhere (even if there is no resulting functional change), while the fix itself is probably very niche. Nikita > > 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 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --000000000000fb9a9c05734cd0e6--