From fe3066e83f12e3016dd08ad78db536153f948db8 Mon Sep 17 00:00:00 2001 From: Christoph Michael Becker Date: Tue, 25 Aug 2020 13:18:01 +0000 Subject: [PATCH] Reapply accidentially lost part of fix for bug #80003 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@350380 c90b9560-bf6c-de11-be94-00142212c4b1 --- language/operators.xml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/language/operators.xml b/language/operators.xml index 3d73a0df18..484a054f8f 100644 --- a/language/operators.xml +++ b/language/operators.xml @@ -2520,7 +2520,8 @@ bool(false) instanceof does not throw any error if the variable being tested is not - an object, it simply returns &false;. Constants, however, are not allowed. + an object, it simply returns &false;. Constants, however, were not allowed + prior to PHP 7.3.0. Using <literal>instanceof</literal> to test other variables @@ -2543,6 +2544,26 @@ bool(false) bool(false) bool(false) PHP Fatal error: instanceof expects an object instance, constant given +]]> + + + + + As of PHP 7.3.0, constants are allowed on the left-hand-side of the + instanceof operator. + + Using <literal>instanceof</literal> to test constants + + +]]> + + &example.outputs.73; + +