Closures: updating code for php 5.2 compatibility

`is_a` is deprecated in PHP 5.2, though undeprecated later.
However, it cannot be called in PHP 5.2 as this issues
a warning and also breaks a whole lot of tests.

Alternatively, do not call `is_a` or any of the `Closure`
handling if the version is PHP 5.2

Using `is_object(?) && ? instanceof Closure` will not work
because `? instanceof Closure` is actually a *syntax*
error if `?` is a constant.  This requires avoiding
the call to `? instanceof Closure` altogether, which
requires `is_a`.