phpc.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A server for PHP programmers & friends. Join us for discussions on the PHP programming language, frameworks, packages, tools, open source, tech, life, and more.

Administered by:

Server stats:

840
active users

Matthew Weier O'Phinney

@thiemo @Crell

This was in library code, but I've done it in my own code as well.

Since we couldn't previously typehint on resources, we'd test (a) to see if we had actually received a resource, and (b) that it was a resource of the correct type (get_resource_type() === '...' or strstr or preg_match operations). The latter doesn't work with the new resource classes.