Le dim. 26 sept. 2021 à 14:42, Jordi Boggiano <j.boggi...@seld.be> a écrit :

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

I'm not sure about this one: is_resource($foo) ? get_resource_type() is
pretty common. Also this would break some expectations with gettype($foo)

Nicolas

>

Reply via email to