Tag: type-hinting

PHP Type Checking

Here’s a quick and dirty utility method for type checking an object or an array of objects. [cc escaped=”true” lang=”php”]/** * Ensure the object (or the first item in the * array of objects) is of the specified type *

Tagged with: , , ,

PHP Type Hinting – Good practices

Let me introduce you “Type hinting” Lets face it, PHP was thought and developed as a weakly typed programming language. But with more and more Object Oriented Approaches and structures introduced into PHP it needs to comply to certain rules.

Tagged with: , ,
Top