Re: BC breaking changes in PHP 8.1

From: Date: Sun, 26 Sep 2021 12:42:30 +0000
Subject: Re: BC breaking changes in PHP 8.1
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-116174@lists.php.net to get a copy of this message
I'm surprised that is_resource() returns false for resource objects, does anyone knows why it wouldn't return true in such case ? This is a very weird behavior, I'd expect it to return true, moreover this is the most annoying detail of this BC break, in my opinion. I have lots of code using is_resource() but I usually don't bother checking for type (maybe I'm doing it wrong). But I'd also expect get_resource_type() to be deprecated somehow and return backward-compatible values for converted resources to objects.
Right, having is_resource return true for resourcey objects would have prevented all resource-related errors I ran into with php8.0 migration I believe. That'd be a welcome improvement/fix for 8.1. Best, Jordi -- Jordi Boggiano @seldaek - https://seld.be

« previous php.internals (#116174) next »