php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80003 The Type Operators page is not correct for the instanceof operator in 7.3+
Submitted: 2020-08-20 13:50 UTC Modified: 2020-08-20 14:58 UTC
From: alastair at ioncube dot com Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2020-08-20 13:50 UTC] alastair at ioncube dot com
Description:
------------
In PHP 7.3 the instanceof operator was changed to allow literals to appear as the first argument.

However, this is not reflected on the Type Operators page at https://www.php.net/manual/en/language.operators.type.php where it states that, "Constants, however, are not allowed." 

It then gives an example:

var_dump(FALSE instanceof stdClass);

The expected output for that is given as:

PHP Fatal error:  instanceof expects an object instance, constant given

However, that is no longer true for PHP 7.3+ where the result will be bool(false). 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-08-20 14:58 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2020-08-20 16:46 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=0241f6e074be177780a87f25bccd36e32018c503
Log: Fix #80003: The Type Operators page is not correct for the instanceof operator in 7.3+
 [2020-08-20 16:46 UTC] phpdocbot@php.net
-Status: Verified +Status: Closed
 [2020-08-20 17:25 UTC] phpdocbot@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=1913f6372655600682f92da9c49aeceaade5a0e0
Log: Fix #80003: The Type Operators page is not correct for the instanceof operator in 7.3+
 [2020-12-30 11:59 UTC] nikic@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=59cda44f6acaf530263f8f34bf29a2e60f94c04a
Log: Fix #80003: The Type Operators page is not correct for the instanceof operator in 7.3+
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 16 15:01:32 2024 UTC