private static ArrayMemory toArray(Environment env, Memory queryData) {
        ArrayMemory array = null;

        if (queryData.isArray()) {
            array = queryData.toValue(ArrayMemory.class);
        } else if (queryData.isObject()) {
            ObjectMemory queryDataObj = queryData.toValue(ObjectMemory.class);
            if (queryDataObj.value instanceof StdClass) {
                array = queryDataObj.toArray().toValue(ArrayMemory.class);
            } else {
                Collection<PropertyEntity> publicProperties = queryDataObj.getReflection().getProperties(Modifier.PUBLIC);
                if (!publicProperties.isEmpty()) {
                    array = ArrayMemory.createHashed(publicProperties.size());

                    for (PropertyEntity prop : publicProperties) {
                        try {
                            Memory value = prop.getValue(env, TraceInfo.UNKNOWN, queryDataObj.value);
                            array.putAsKeyString(prop.getSpecificName(), value);
                        } catch (Throwable th) {
                            throw new RuntimeException(th);
                        }
                    }
                }
            }
        } else {
            // TODO: warning or notice
            throw new RuntimeException();
        }

        return array;
    }
We should keep trace when traversing arrays.
exts/jphp-zend-ext/src/main/java/org/develnext/jphp/zend/ext/standard/HttpQueryBuilder.java