Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101274 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91577 invoked from network); 9 Dec 2017 06:35:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Dec 2017 06:35:36 -0000 Authentication-Results: pb1.pair.com header.from=kalle.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=kalle.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.177 as permitted sender) X-PHP-List-Original-Sender: kalle.php@gmail.com X-Host-Fingerprint: 209.85.223.177 mail-io0-f177.google.com Received: from [209.85.223.177] ([209.85.223.177:43407] helo=mail-io0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/C2-62356-5348B2A5 for ; Sat, 09 Dec 2017 01:35:34 -0500 Received: by mail-io0-f177.google.com with SMTP id s37so4600459ioe.10 for ; Fri, 08 Dec 2017 22:35:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=2mRc/kS1Zk1K+vnN466Siv3DLcFRKIRv1rEZvgnCrEA=; b=a3XMn+6NdtIbolEI89lXh60+pDfMPu3MOtViz0awDUCyjpHeOQ06zZT50X1FwKdvvS XYdOAYXzvnaMbVs+a7UvvzhhPIvTbzrtB03Fh4ailV8428viyJwecGzTotMuwdiAm9Ex 8Kg+hPwyq0+wnRo1g/xlkzr7Ts43TSxNqAtnMWf/KSpRID2leJPvyl0cJ5dXw3DUXFbG vmPVdM66dQ9R6X0PdYJ35yT8BugxoCznPGXc9kmJd65hZB9uuAqHuvzEXBC6Z0gEbzFV ssswuCKu2hiN/Sl00qflnds+ZG6n2hoAEpNAmSEmzP583GVb3fUOBo7WlfyvLVWCU242 u4aA== 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=2mRc/kS1Zk1K+vnN466Siv3DLcFRKIRv1rEZvgnCrEA=; b=lRPN1uESkhVOeADLkgDnAa1qfcCItlpODhvOUR4fcG6XVEVs/y3NV6vEu41jm4dMTg MyvvFPOU9aXa7+eTzrR5toME1EQSKdL4qUsLnxbrE7YuJVkZW8ptOYc1Ss3p3DrJYq42 KbTp77gwwdnzKLpN4L3bQO834XXA0hZmizfzJb9FJWIqFq2B8vPbHg9LNeLHZH451IJd iOa5kE/ELsJylo7k/dyj97TvrTAe1//9x4IMHzGBTXqkoWl5D4ZC1uLOdS9Yow2T0Gbw aTQ0hcioY/Rt7RTFu39sVBKzCy/bJEXSToCRmcslrdPkQloWohbkEy7roGLY0TJ+zuSd /SjQ== X-Gm-Message-State: AKGB3mIEVjbHx5LLojgdrGn+vIuWuArYNrQpFr9x3vF7Cb2eYyRSD+IE nN0kWZm9Q7b93fAKAhtfcn4BQHZySIAQe5Fmf4U= X-Google-Smtp-Source: ACJfBot0HkGXmXKtQVpJ68GaZOJLMR1+UKLvPJzZKRl+1EgtY8oFp9oxM8MkXwnXwaZWlV6k8owEo8tMc/Wz5++FGbo= X-Received: by 10.107.30.76 with SMTP id e73mr1852448ioe.60.1512801331595; Fri, 08 Dec 2017 22:35:31 -0800 (PST) MIME-Version: 1.0 Sender: kalle.php@gmail.com Received: by 10.107.79.6 with HTTP; Fri, 8 Dec 2017 22:35:30 -0800 (PST) Received: by 10.107.79.6 with HTTP; Fri, 8 Dec 2017 22:35:30 -0800 (PST) In-Reply-To: References: Date: Sat, 9 Dec 2017 07:35:30 +0100 X-Google-Sender-Auth: zcTvgyIPs4L4LA3HLqOTvz_r3E8 Message-ID: To: Andreas Hennings Cc: Internals Content-Type: multipart/alternative; boundary="001a1141ac2efc4fae055fe281dc" Subject: Re: [PHP-DEV] instanceof survives non-object variables, but crashes on non-object constants. From: kalle@php.net (Kalle Sommer Nielsen) --001a1141ac2efc4fae055fe281dc Content-Type: text/plain; charset="UTF-8" Hi We should just add a warning to the first example, it seems like an oversight that it was left silent On 9 Dec 2017 07.29, "Andreas Hennings" wrote: > The following (https://3v4l.org/A2Tp6) is ok, it simply returns false: > > $x = 1; > $x instanceof \stdClass; > > > The following (https://3v4l.org/IdSBu) gives a fatal error: > > 1 instanceof \stdclass; > > t think this behavior is inconsistent, and we should consider changing it. > > There are two options, but only one is BC. > > - Let 1 instanceof \stdClass return false, instead of crashing. -> seems BC > - Let $x instanceof \stdClass crash, if $x is not an object. -> BC break. > > So it seems the first would the option we should take. > This is also what hhvm does, according to https://3v4l.org/IdSBu. > --001a1141ac2efc4fae055fe281dc--