PHP 5.4 Type Hints Patch
Note: This article was originally published at Planet PHP on 20 April 1720.
Since I feel that type-hints is a pretty handy feature to have as it eliminates many possible errors, improves code interrogation and addresses some of the limitations currently being worked-around via annotations I've decided to share this patch with the community. The patch is available for download at: http://ilia.ws/patch/php54_type_hints.txt it applies cleanly against PHP 5.4.8 as well as 5.4 branch (5.4.9RC1). I suspect it will work with earlier versions of PHP 5.4 as well. The patch includes full test coverage around the new functionality and all of the existing tests continue to pass (so nothing is broken).