fix issue #23 (PHP-7.1 JSON compat)
[m6w6/ext-pq] / src / php_pq_params.c
index 0f7ba503adbc6b8df6d5b142d77e848f1ccd0179..5a5156ff32d85b758498e3459edc2369cffdcde0 100644 (file)
@@ -83,6 +83,9 @@ static zend_string *object_param_to_string(php_pq_params_t *p, zval *zobj, Oid t
        case PHP_PQ_OID_JSONB:
 #      endif
        case PHP_PQ_OID_JSON:
        case PHP_PQ_OID_JSONB:
 #      endif
        case PHP_PQ_OID_JSON:
+#      if PHP_VERSION_ID >= 70100
+               JSON_G(encode_max_depth) = PHP_JSON_PARSER_DEFAULT_DEPTH;
+#      endif
                php_json_encode(&str, zobj, PHP_JSON_UNESCAPED_UNICODE);
                smart_str_0(&str);
                return str.s;
                php_json_encode(&str, zobj, PHP_JSON_UNESCAPED_UNICODE);
                smart_str_0(&str);
                return str.s;