function is_ref

This function simply test if the given parameter is a Ref object or not.

if (is_ref($arg))
{
    $arg->obj->doFoo();
}