public Collection<CompileFunction> getFunctions() {
        Map<String, CompileFunction> result = new HashMap<String, CompileFunction>();

        for (Method method : getClass().getDeclaredMethods()) {
            int mod = method.getModifiers();
            if (Modifier.isStatic(mod) && Modifier.isPublic(mod)) {
                String name = method.getName();
                Name altName = method.getAnnotation(Name.class);
                if (altName != null)
                    name = altName.value();

                CompileFunction function = result.get(name);
                if (function == null)
                    result.put(name, function = new CompileFunction(name));

                function.addMethod(method);
            }
        }

        for (Map.Entry<String, Method> item : getNativeFunctions().entrySet()) {
            Method method = item.getValue();
            CompileFunction function = result.get(item.getKey());
            if (function == null) {
                result.put(item.getKey(),
                        function = new CompileFunction(
                                item.getKey()
                        )
                );
            }
            function.addMethod(method, true);
        }

        return result.values();
    }
Use expectingReference(Environment env, TraceInfo trace, Memory memory, String funcName)
jphp-runtime/src/php/runtime/ext/support/compile/FunctionsContainer.java