Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101289 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62586 invoked from network); 10 Dec 2017 11:05:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Dec 2017 11:05:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.161 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.161 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.161] ([81.169.146.161:28951] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 20/90-53433-7F41D2A5 for ; Sun, 10 Dec 2017 06:05:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1512903924; s=domk; d=kelunik.com; h=Content-Type:Cc:To:Subject:Message-ID:Date:From:References: In-Reply-To:X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject; bh=fPThXTpbB209mEcXOvHSM3uakvo59sy+Ssi3hFyJwkM=; b=kFZIttJRQhxQ6afJspDbG/XAVtsrGjfWolR+4ij+igFC8iuY1NkFXtFB2rzWIpdTG2 9l9bXi9sJRmGA+ThDrgIoNmi0F+nAPjsCBTcLX5R29HrR3lbX/L19HGsaafWHPjiu6Fk Ik2Qzu2J2cEVvRj2TJNNLNuqQhXZ674RXW12Y= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mlsGbEv0XHBzMIJSS+jKTzde5mDb8Db2nURiu2cA== X-RZG-CLASS-ID: mo00 Received: by mail-yw0-f171.google.com with SMTP id y187so6767125ywd.12 for ; Sun, 10 Dec 2017 03:05:24 -0800 (PST) X-Gm-Message-State: AKGB3mKXky+ypykD745oDDtTxoDOaZyv199uduRX9x+jF21PBvMrNhlS n+8j9qZCGoihQeMCNxFwh/jc8HfhfQYFq3YysOY= X-Google-Smtp-Source: AGs4zMa5OJUcHostthEZWDLxhKMe/Yaln08ZAUsuG8zrm5YEkoZyY1VuFxWQYhOG3XKaapJhUDWXdPTtIL+sj0gtXq0= X-Received: by 10.37.47.129 with SMTP id v123mr7490871ybv.424.1512903924170; Sun, 10 Dec 2017 03:05:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.124.71 with HTTP; Sun, 10 Dec 2017 03:05:23 -0800 (PST) In-Reply-To: References: Date: Sun, 10 Dec 2017 12:05:23 +0100 X-Gmail-Original-Message-ID: Message-ID: To: Sara Golemon Cc: Andreas Hennings , PHP internals Content-Type: multipart/alternative; boundary="001a1140cbeafac4c7055ffa641f" Subject: Re: [PHP-DEV] instanceof survives non-object variables, but crashes on non-object constants. From: me@kelunik.com (Niklas Keller) --001a1140cbeafac4c7055ffa641f Content-Type: text/plain; charset="UTF-8" > > 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 Regards, Niklas --001a1140cbeafac4c7055ffa641f--