protected static boolean expecting(Environment env, TraceInfo trace, int index, Memory memory, Memory.Type type) {
        if (memory.getRealType() != type) {
            env.warning(trace, "expects parameter " + index + " to be " + type.toString() +
                    ", " + memory.getRealType().toString() + " given");
            return false;
        }
        return true;
    }
Use expectingReference(Environment env, TraceInfo trace, Memory memory, String funcName)
jphp-runtime/src/php/runtime/ext/support/compile/FunctionsContainer.java