Can a ref port be used for static methods?

i have tried in eda playground - synopsys shows no errors whereas cadence and other simulators shows errors.

which is correct?

if so then why cant we use for static methods ?

In reply to sreelaxmi:
I think you meant to say routines with a static lieftime, not static methods. There is a big difference between the two. All class methods always have automatic lifetimes

It shall be illegal to use argument passing by reference for subroutines with a lifetime of
static

The reason for this rule is because the arguments to routines with static lifetimes are static variables that can be accessed outside the call to the routine. If the routine has never been called before, or has been called passed with an argument that no longer exists, then accessing that argument would be an invalid reference to some unknown location.