Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108089 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 87397 invoked from network); 10 Jan 2020 16:20:35 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 Jan 2020 16:20:35 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E1F321804A8 for ; Fri, 10 Jan 2020 06:26:29 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, 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-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (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 ; Fri, 10 Jan 2020 06:26:29 -0800 (PST) Received: by mail-lf1-f48.google.com with SMTP id 15so1622583lfr.2 for ; Fri, 10 Jan 2020 06:26:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F2cIzj7AJyWNHoJ9BcYIspv3897rVbpyKkVm+7CYLRQ=; b=nxRfBQVUCnahdhbpZwyhn9+Sc2GPf8C6LCK1BzWRcM0bLC7BYqnqDmCzGqctrEk+Zo cKVfVGvVxDlNMB5wpUumK3/VKxbm4TbBmeIR+J4LiuSNh1SAs9B8QaYSujN7CV8Y6DAB brGu8NG8FSbBrwJiisQ7DX05LRthX5yCl/Iuw4qR3GNiObRyZbP7oLmgqkeAxC3cMiGK jCw7ZgPzQdaPRzJaSDuqadMCv3J2hdwd9dZjvUC+a6w63klDuJP8lGhwRHZ9FDehr4q7 szDT44vTtyq5Xj5EUQiuMuWjvnD35UdX92NW0IOsnuNUp2EkQ3TlLkRJiVM9Tq+qoFlD f7wA== 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=F2cIzj7AJyWNHoJ9BcYIspv3897rVbpyKkVm+7CYLRQ=; b=fJy2fdjJSghAJCQOVxlEnkIu9TH+qhmFmnuRHtw+S7Nn1QWHVoZCoYIxyePJNnPsz1 BeM+lA/2XIR7HkVo+GYM14QAA8pXVyYO3INEO+75ls6T7Mcuw0MFwDcJ+2VH6+5ob7jW DO2CdF7LreFRmCinwP6Gy74sI2DMrd5G0bwiB/EAVYVjaZgPRdEsDCfzAzgudhKld+su 2onjS1ru0DSy8OtuFpm7Xz0nvEqYmmwE5lcVMNJY2cAik/tnYQRXjmFLQILKVmjyE8M5 khtg41H2CzgDp15gBbvkDZg+popS+WkfXFrdMp1vlxcJtn94JFHj7e+L3x1s4XWKBDW6 3pmQ== X-Gm-Message-State: APjAAAU3wd/MyuWSVoz1gSO/t4Xu88gSwvhpXDGuTPP6aDjj4/U54qX4 6uJt2Mn6QMGRGpxuHrsKWcZzEq/5hc7ZlXmu/w== X-Google-Smtp-Source: APXvYqw68itB6EMyAcb6P5mqRuI4O2JmpQkNl2F52uqHgm1j/nAD/sj58cOs1WgyStek11wJSSeCSrWlzUCeMzqs+Do= X-Received: by 2002:ac2:44ce:: with SMTP id d14mr2607766lfm.140.1578666387224; Fri, 10 Jan 2020 06:26:27 -0800 (PST) MIME-Version: 1.0 References: <13CC52AA-7690-42C6-89B7-B8FA4166BF38@newclarity.net> <57c08851-e6e2-c0bd-76e1-f7a0388d64b4@ralphschindler.com> <60610660-2E38-47BD-A998-1E226CEB3701@newclarity.net> In-Reply-To: Date: Fri, 10 Jan 2020 15:26:15 +0100 Message-ID: To: Kalle Sommer Nielsen Cc: Mike Schinkel , Ralph Schindler , Internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Allow ::class on objects From: guilliam.xavier@gmail.com (Guilliam Xavier) Hi, On Thu, Jan 9, 2020 at 10:02 PM Kalle Sommer Nielsen wrote: > > [...] > > use Interfaces; > if(!$object instanceof Interfaces\MyInterface) > { > // Notice the ! is right associative and instanceof is non > associative, hence the lack of parantheses > } Sorry for off-topic but that comment is incorrect: the fact that `!$x instanceof Foo` is evaluated as `!($x instanceof Foo)` (which I find more readable with explicit parentheses, by the way) is not due to the *associativity* of the operators but to their relative *precedence*. For instance, `===` is non-associative too but `!$x === 42` is evaluated as `(!$x) === 42` (not as `!($x === 42)`). According to the docs, associativity only matters for operators of equal precedence, e.g. `4 - 3 - 2` is evaluated as `(4 - 3) - 2`, and `4 ** 3 ** 2` is evaluated as `4 ** (3 ** 2)`. -- Guilliam Xavier