1.2.929. 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 :

See also Resource to object migration.

1.2.929.1. Connex PHP features

1.2.929.1.1. Suggestions

  • Change the condition from is_resource() to instanceof

1.2.929.1.2. Specs

Short name

Php/Php80RemovesResources

Rulesets

All, CE, CompatibilityPHP80

Exakat since

2.2.0

PHP Version

With PHP 8.0 and more recent

Severity

Major

Time To Fix

Quick (30 mins)

Precision

Medium

Available in

Entreprise Edition, Community Edition, Exakat Cloud