public int getRequiredParamCount() {
        int cnt = 0;

        if (parameters != null) {
            for (ParameterEntity e : parameters) {
                if (e.hasDefaultValue())
                    break;
                cnt++;
            }
        }

        return cnt;
    }
0 - success
1 - invalid protected
2 - invalid private
@param env
@return
jphp-runtime/src/php/runtime/reflection/MethodEntity.java