+/* {{{ Sara Golemons http_build_query() */
+#ifndef ZEND_ENGINE_2
+
+/* {{{ proto string http_build_query(mixed formdata [, string prefix[, string arg_separator]])
+ Generates a form-encoded query string from an associative array or object. */
+PHP_FUNCTION(http_build_query)
+{
+ zval *formdata;
+ char *prefix = NULL, *arg_sep = INI_STR("arg_separator.output");
+ int prefix_len = 0, arg_sep_len = strlen(arg_sep);
+ phpstr *formstr;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ss", &formdata, &prefix, &prefix_len, &arg_sep, &arg_sep_len) != SUCCESS) {
+ RETURN_FALSE;
+ }
+
+ if (Z_TYPE_P(formdata) != IS_ARRAY && Z_TYPE_P(formdata) != IS_OBJECT) {
+ http_error(E_WARNING, HTTP_E_PARAM, "Parameter 1 expected to be Array or Object. Incorrect value given.");
+ RETURN_FALSE;
+ }
+
+ if (!arg_sep_len) {
+ arg_sep = HTTP_URL_ARGSEP;
+ }
+
+ formstr = phpstr_new();
+ if (SUCCESS != http_urlencode_hash_implementation_ex(HASH_OF(formdata), formstr, arg_sep, prefix, prefix_len, NULL, 0, NULL, 0, (Z_TYPE_P(formdata) == IS_OBJECT ? formdata : NULL))) {
+ phpstr_free(formstr);
+ RETURN_FALSE;
+ }
+
+ if (!formstr->used) {
+ phpstr_free(formstr);
+ RETURN_NULL();
+ }
+
+ RETURN_PHPSTR_PTR(formstr);
+}
+/* }}} */
+#endif /* !ZEND_ENGINE_2 */
+/* }}} */
+
+PHP_FUNCTION(http_test)
+{
+ RETURN_NULL();
+}