1.2.922. PHP 8.0 Resources Turned Into Objects¶
Multiple PHP native functions now return objects, not resources. Any check on those values with is_resource() is now going to fail.
The affected functions are the following :
socket_wsaprotocol_info_import()
See also Resource to object migration.
1.2.922.1. Suggestions¶
Change the condition from is_resource() to instanceof
1.2.922.2. Specs¶
Short name |
Php/Php80RemovesResources |
Rulesets |
|
Exakat since |
2.2.0 |
PHP Version |
All |
Severity |
Major |
Time To Fix |
Quick (30 mins) |
Precision |
Medium |
Features |
resource |
Available in |