In PHP 5, this displays as bool(true), but in PHP 4, it displays bool(false). The reason is that in PHP 4, objects are simply glorified associative arrays, and so PHP treats the above [example] code exactly the same.
Recently, some code in the PEAR installer was discovered to be invalid in PHP 4. After a bit of investigation, I realized that the significant difference in the way objects are represented internally in PHP 5 was the culprit.
He strongly suggests that, to help with this issue, you always check to ensure (with is_object) that what you're passing is a true object.
He's made an update to the post since it was originally released, mentioning how some classes will also define their own cast handlers.











