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; + +