public static void checkYieldReference(Memory memory, Environment env, TraceInfo trace) {
        if (memory.isImmutable()) {
            env.error(trace, ErrorType.E_NOTICE, Messages.ERR_YIELD_NOT_REFERENCE.fetch());
        }
    }
Method is invoked via bytecode

@throws Throwable
jphp-runtime/src/php/runtime/invoke/InvokeHelper.java