Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101285 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38323 invoked from network); 9 Dec 2017 23:09:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Dec 2017 23:09:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.42 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.160.42 mail-pl0-f42.google.com Received: from [209.85.160.42] ([209.85.160.42:40208] helo=mail-pl0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 64/48-62356-D2D6C2A5 for ; Sat, 09 Dec 2017 18:09:33 -0500 Received: by mail-pl0-f42.google.com with SMTP id 1so2427454pla.7 for ; Sat, 09 Dec 2017 15:09:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=fuc/DX/UYGhrzQ233B3hoDvK13lOI5KVI3m3kVIZNRo=; b=jpSKNDTWFh4s8R7fTJWKmtBqlSJl/kUUP+LmgA0DRTjTVTlIXbUrnNPWj2zg4Kb83c ishaFOSuVUj9Y3GBfoHPGGE8z3+rEu6nRBs2fd1/49Uf8JnxlJNvJviBYjDl5Nu6U4HQ uiHCae/1bGS3IHv2Rqr/+fhs1o9qcqljerRhimCm4AxoTluBvPVkA53Dcz6MO7sBgTz9 XJhqODOqNeZU61wqnl0Smkzp0gn8q5XN8dGKfV6k1QolmGy9Wax62CBdueazv0HEaAGR j6zQxraj/mBAycnxcYg+GrNkjq16ulBo8ECvc+tA+zfJs0Hr6zkDH5UkDI47tABb2Jla Lbfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fuc/DX/UYGhrzQ233B3hoDvK13lOI5KVI3m3kVIZNRo=; b=tX505f3YMAxSimg/Hhd11KnHV+GL/PV/7jBIS+TfE75dSRUDo20hDow7F+juZdXpqu YFoVIqKO71tRocDkCm+IvlQpQQEhk/drZWE5YnzSdFienq3ZZRLdF1LvlQykzpoH3PR/ wSZyNse6fy15YFCK+j6PXmSlx8UE4yTYczE+x0X/Lk3687GD3fC0NJJgrt3klDHVP897 4iX7hrc2NVg9JYTZBnbFnEhaoNIP3Koe3wWJXTcmQ7qtd9Ec33OzBjseL2KuFCFTEafO DyE0HRjSzSm08Ub1clee504qOuLNDrvldb7kHy1q15k53zjQER4mtuAWSf37YxuntiRB V3ig== X-Gm-Message-State: AJaThX4Mj1Exw6atzofxr4sNhS71tgBe1mQ0gMy4RrXx6CKQqV0o9Ha6 NnCreHs8wPoH8+ugkcaY2BdSRBQ= X-Google-Smtp-Source: AGs4zMYq4eiD6edJliK8INlYgzlJJ185kp8eiObj06GZM6VBDE38dlGqKiRmQrWZgvSTIN/wwi6xFQ== X-Received: by 10.84.193.36 with SMTP id e33mr35191542pld.313.1512860970335; Sat, 09 Dec 2017 15:09:30 -0800 (PST) Received: from Stas-Pro-2016.local (c-73-71-144-171.hsd1.ca.comcast.net. [73.71.144.171]) by smtp.gmail.com with ESMTPSA id 69sm19352059pfj.28.2017.12.09.15.09.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Dec 2017 15:09:29 -0800 (PST) To: Andreas Hennings , PHP internals References: Message-ID: <50e2ef67-7f9e-3910-988d-684cf9c57be3@gmail.com> Date: Sat, 9 Dec 2017 15:09:28 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; 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: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] instanceof survives non-object variables, but crashes on non-object constants. From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > 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. Neither of those "crashes", one of them returns fatal error, which is a valid option for code that is obviously broken. It would also be a valid option to return false, but since it is a valid outcome either way, I don't think changing anything is necessary. It does not make any real code easier to write (I can't see any legit reason to test numerics for being instance of anything) and does not improve anything but abstract "consistency", which in this case is not useful for anything. -- Stas Malyshev smalyshev@gmail.com