.. _php-php80removesresources: .. _php-8.0-resources-turned-into-objects: 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 : + `curl_init() `_ + `curl_multi_init() `_ + `curl_share_init() `_ + `deflate_init() `_ + `enchant_broker_init() `_ + `enchant_broker_request_dict() `_ + `enchant_broker_request_pwl_dict() `_ + `inflate_init() `_ + `msg_get_queue() `_ + `openssl_csr_new() `_ + `openssl_csr_sign() `_ + `openssl_pkey_new() `_ + `openssl_x509_read() `_ + `sem_get() `_ + `shm_attach() `_ + `shmop_open() `_ + `socket_accept() `_ + `socket_addrinfo_bind() `_ + `socket_addrinfo_connect() `_ + `socket_create_listen() `_ + `socket_create() `_ + `socket_import_stream() `_ + socket_wsaprotocol_info_import() + `xml_parser_create_ns() `_ + `xml_parser_create() `_ See also `Resource to object migration `_. Connex PHP features ------------------- + `resource `_ Suggestions ___________ * Change the condition from is_resource() to instanceof Specs _____ +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Short name | Php/Php80RemovesResources | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Rulesets | :ref:`All `, :ref:`CE `, :ref:`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 `_ | +--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+