public static function isEmpty(callable $callback, Context $context): bool
    {
        $policy = $context->setAccessPolicy(Context::ACCESS_POLICY_RETURN_NULL);
        
        try {
            $val = $callback($context);
        } finally {
            $context->setAccessPolicy($policy);
        }
        
        if ($val instanceof \Countable) {
            return $val->count() == 0;
        }
        
        return empty($val);
    }
public static function isEmpty(callable $callback, Context $context): bool
    {
        $policy = $context->setAccessPolicy(Context::ACCESS_POLICY_RETURN_NULL);
        
        try {
            $val = $callback($context);
        } finally {
            $context->setAccessPolicy($policy);
        }
        
        if ($val instanceof \Countable) {
            return $val->count() == 0;
        }
        
        return empty($val);
    }
public static function isEmpty ( callable $ callback , Context $ context ) : bool { $ policy = $ context -> setAccessPolicy ( Context :: ACCESS_POLICY_RETURN_NULL ) ; try { $ val = $ callback ( $ context ) ; } finally { $ context -> setAccessPolicy ( $ policy ) ; } if ( $ val instanceof \ Countable ) { return $ val -> count ( ) == 0 ; } return empty ( $ val ) ; }
Check if a return value is empty. A value is considered empty if it cannot be accessed or
if it is countable and count is 0 or if PHP's empty-operator returns true when the
vallue is passed.

@param callable $callback Callback being used to compute the value.
@param Context $context Expression context to be passed to the callback.
@return bool Returns true if the computed value is empty.
Check if a return value is empty . A value is considered empty if it cannot be accessed or if it is countable and count is 0 or if PHP s empty - operator returns true when the vallue is passed .