public static Memory checkReturnType(Environment env, TraceInfo trace, Memory result, final MethodEntity method) {
        return checkReturnType(
                env, trace, result,
                new Function<String>() {
                    @Override
                    public String call() {
                        ClassEntity clazz = method.getClazz();

                        switch (clazz.getType()) {
                            case CLOSURE:
                                return "{closure}";
                            default:
                                return clazz.getName() + "::" + method.getName();
                        }
                    }
                },
                method.getReturnTypeChecker(), method.isReturnTypeNullable()
        );
    }
Method is invoked via bytecode

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