Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101290 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66608 invoked from network); 10 Dec 2017 12:44:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Dec 2017 12:44:41 -0000 Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.15.18 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.15.18 mout.gmx.net Received: from [212.227.15.18] ([212.227.15.18:62499] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B1/01-53433-83C2D2A5 for ; Sun, 10 Dec 2017 07:44:40 -0500 Received: from [192.168.2.106] ([79.243.116.101]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LfSyv-1eqS1S1k09-00p0ut; Sun, 10 Dec 2017 13:44:35 +0100 To: Niklas Keller , Sara Golemon Cc: Andreas Hennings , PHP internals References: Message-ID: Date: Sun, 10 Dec 2017 13:44:34 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:n5yBkshrWdTS/DfkwKCASsm+dVFbqz51P4Bca5LABSdp7IgfIDt AgyAvUGgz1Udq2Aa6sfBuyc+yS/ErFwAFdLk3Y2xVtb1QPoSFgXB+9tD3LPyvTvVSwrMXq2 Wlsebg6ebHbYUULpAaC9iB6DEXBUotfZVYtS/ZBVyPvA9v30wi+xVt4TEVeSA3xEeZpk5Sx zzJv+DErv9AmSJ+IPVn7w== X-UI-Out-Filterresults: notjunk:1;V01:K0:CVu5dNfNkNs=:0leTNvR72PdDn2+Rjvhvfh N5UzL96Wa/OnHEhTQTBFJnGcJ2ODbNOUN1VaF1vlyzyYAzFUsUiZ1QUSGqqWA7x11Mv6fLe9V IWOr3pcrARgasWYV7DkhMufMcBjkmbhBDMNemnGzw5a09aW+L6N94UIWyxlIcVkdPsjm+JNPA mp+IvXVgN/kWwH5EDPRjYfNakFC69l9VfAajBh563hxqKY2KPD3YhTt8CZjnLl8j7U6DShSlS xMp/Yag1io2wnX6sAK08oHhwZ1yAi2fIs+K+VMRcgWlFlnh/Ggd6AgOyq8CuIPL3Wc2rWeTCJ SytPYb8bgoyytDg8x4rm6OItXshHGkIspIlimOPeGSAzSxaIod0Iouwko7MBiHCd36ox/qXUg vy3LSbdvvYKSBdbUPDGdwEsiA91C//SOsuUQqQoLbpAdyms5eSzgVn8+S304K86t06XBrKoVk DBj1f3GGFfUkszOe5r07pQ6hIq/DvC0ps4AtYfQ/DbZndDaN7xYgfgPFccoKJOi6WDvJsxT8F Vaqh2le8t/l591WOqA4tY0c6Z9S53TH17M1PCh2Vd4w0njFw9cxGFr1BU1n22cBBD8qLYv3um 9HIXhVT+HuBhPvSdqRtzTnexkMdZ8L/5QSjYPO2nMPPzRPnhS7qiX4z83YqDJu7H5DeZzwJWp wCzOBPAVQIzdGKP90mzB6Heir0opRGCARLCYARpj5pE4a/NlsbSZuA77xUsG9oi1LANCqgqFx y3pScv8HAQ+YMqfYYQ4XYprYzLANyawgyB9ISMjFEJxF4J0TFiDU/xxlkA+uGmwAFF3Uz7TTT 84AciTdufSa012H9Htn/s2+N+ILz54HnYnKh6ZasGvmJUKNzt0= Subject: Re: [PHP-DEV] instanceof survives non-object variables, but crasheson non-object constants. From: cmbecker69@gmx.de ("Christoph M. Becker") On 10.12.2017 at 12:05, Niklas Keller wrote: >> This. There's nothing undefinable about "1 instanceof \stdClass", the >> clear and obvious answer is: "No, it's not an instance of \stdClass, >> it's an integer." The runtime result of false makes sense, the >> compile time error doesn't. Let's relax the compile time error (fold >> it into a const false if you truly must) and call it done. There's no >> need to be hostile to users just because the code *seems* silly. > > This code doesn't just *seem* silly. For everything but testing whether it > works it is totally useless. > > But we might turn the fatal error into a warning like we do it for "use" in > the global namespace: https://3v4l.org/ph7KW I fail to see why 1 instanceof \stdClass should be handled differently than 1 === (new stdClass) for instance. -- Christoph M. Becker