As others have noted, you currently cannot do this. If you really cannot use a temporary variable (although I see no reason not to use it), you can use
if(current(className::func())) // or next() or reset()
But make sure you read the documentation for these functions to handle empty arrays correctly.
Link : current
source share