Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101291 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67972 invoked from network); 10 Dec 2017 12:45:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Dec 2017 12:45:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.177 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.128.177 mail-wr0-f177.google.com Received: from [209.85.128.177] ([209.85.128.177:41401] helo=mail-wr0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D1/51-53433-97C2D2A5 for ; Sun, 10 Dec 2017 07:45:45 -0500 Received: by mail-wr0-f177.google.com with SMTP id z18so14868698wrb.8 for ; Sun, 10 Dec 2017 04:45:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:from:message-id; bh=OO7wPnhKBLOb6c6MuH9gKzI3+IBNzS298NsSDb2socc=; b=I7BWbpE6MS/hBCdaLHOmOk3rHHWCCGc2/smkRClqSpyJOxJeHE9QzbQ6cvMaKJJ0Ix 5QHg2Tb5yzhZqbqzSQNNRP6CjN29EB+6zdLT7i29aJuc7wterDp41yf6O766V1lPeywQ 2xQn6aLXFGnNyPOzCe7PIA0uC+5C5Dx6aE01/LwRKeieQvKtziEZldB0y0FmDsaD+Vhm OoZyUKBVvLCNk8eq0iPugj/xOeineJhyWjN3lITtvAbrZSicpVn5CKgLTZKA3aFZBvnU tPIm3ROA2R7MlAYeV6x61q9RcpdCn2WA+Y92Ad2kSneMsuoOh00qJe3E/+qG6ErsZdSz nTxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:from:message-id; bh=OO7wPnhKBLOb6c6MuH9gKzI3+IBNzS298NsSDb2socc=; b=XdMqtCndxMYGwIk+GV9vLFnKstbfl2vl/FND28VcHrMJ/bgBRNl54f8mCqku6P4zrf ofs0cBjDa+kwPOiyG6TsF6cS2SDhMmptrX2T9RvEzCvyhfKXMUYMcvfKi0hH2H88JMZe 0VqAC8tcV6AUGz7PqzsatM+564H/taioBgHIHeMLjECaQYKKoLApXwcmeMzgbmqP2JU3 mBd1oUzNGdKE3jOGxVw9WIEgk1yygDAcr1tTnOYaXmR06eJFGypyX7c1PLQjlTLU/khn Uj4YlNtgQXwZgKAQRgLEz/0yUr6XxAhnsiFDnwyGNgCDdPJ6s6sL6/xXWPzND+VbMuMc UzFQ== X-Gm-Message-State: AJaThX7RSMK4iRQSyoSeUx4GRjaSr31VGybD5T/aNPpk/CMPZAyP7xI6 EV6qTa73x4jzCatU/U9dtc4HfQ== X-Google-Smtp-Source: AGs4zMaJlPwGqskoOTxh+yRB5zM/YYQpW44cn+MhdiAipZ5k+m2lfUkYd+YTOboDC6CeA9X9hcG6uA== X-Received: by 10.223.166.235 with SMTP id t98mr34498846wrc.251.1512909942865; Sun, 10 Dec 2017 04:45:42 -0800 (PST) Received: from ?IPv6:2a00:23c4:4b81:ae00:69d6:99e8:1d38:80f? ([2a00:23c4:4b81:ae00:69d6:99e8:1d38:80f]) by smtp.gmail.com with ESMTPSA id d18sm14959916wrd.54.2017.12.10.04.45.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Dec 2017 04:45:41 -0800 (PST) Date: Sun, 10 Dec 2017 12:45:39 +0000 User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: internals@lists.php.net Message-ID: <560EA30C-02FD-4389-B9D3-F577C1DF6B41@gmail.com> Subject: Re: [PHP-DEV] instanceof survives non-object variables, but crashes on non-object constants. From: rowan.collins@gmail.com (Rowan Collins) On 10 December 2017 11:05:23 GMT+00:00, Niklas Keller wr= ote: >> >> This=2E 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=2E" The runtime result of false makes sense, the >> compile time error doesn't=2E Let's relax the compile time error (fold >> it into a const false if you truly must) and call it done=2E There's >no >> need to be hostile to users just because the code *seems* silly=2E >> > >This code doesn't just *seem* silly=2E For everything but testing whether >it >works it is totally useless=2E It's useless, but also harmless=2E Unless anyone can think of a scenario w= here someone would do this by mistake intending to do something else? >But we might turn the fatal error into a warning like we do it for >"use" in >the global namespace: https://3v4l=2Eorg/ph7KW I feel like both that example and the case we're discussing should be a no= tice at most; it's not telling me my code is broken, just that some of it's= unnecessary=2E Maybe I've decided it makes my code more self-documenting, = and don't care that the compiler thinks I'm dumb=2E Adding warnings has a "boy who cried wolf" cost: if people get used to ign= oring ones they disagree with, they'll miss ones that are genuine problems= =2E=20 Regards, --=20 Rowan Collins [IMSoP]