Question

I have a class that accepts a GD image resource as one of its arguments. As far as I know, there is no way to type hint this since it is a resource and not an object. Is there a way to validate whether the supplied argument is a valid GD image resource (aside from further functionality using this resource failing)?

PS: Please do not mention ImageMagick in your answer...

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top