25#include <libxml/parserInternals.h>
62static xmlNodePtr to_xml_datetime_ex(
encodeTypePtr type,
zval *
data,
char *format,
const char *ext_date_format,
size_t ext_date_format_len,
int style, xmlNodePtr parent);
86static int is_map(
zval *array);
89static xmlNodePtr check_and_resolve_href(xmlNodePtr
data);
91static void set_ns_prop(xmlNodePtr node,
char *ns,
char *
name,
char *
val);
92static void set_xsi_nil(xmlNodePtr node);
93static void set_xsi_type(xmlNodePtr node,
char *
type);
95static void get_type_str(xmlNodePtr node,
const char* ns,
const char*
type,
smart_str*
ret);
96static void set_ns_and_type_ex(xmlNodePtr node,
char *ns,
char *
type);
100#define FIND_XML_NULL(xml,zval) \
107 if (xml->properties) { \
108 null = get_attribute(xml->properties, "nil"); \
116#define CHECK_XML_NULL(xml) \
123 if (xml->properties) { \
124 null = get_attribute(xml->properties, "nil"); \
132#define FIND_ZVAL_NULL(zval, xml, style) \
134 if (!zval || Z_TYPE_P(zval) == IS_NULL) { \
135 if (style == SOAP_ENCODED) {\
237 while (*str !=
'\0') {
238 if (*str ==
'\x9' || *str ==
'\xA' || *str ==
'\xD') {
252 while (*str ==
' ') {
256 while (*str !=
'\0') {
257 if (*str !=
' ' || old !=
' ') {
272 if (
sdl &&
sdl->encoders) {
276 if (
type[0] ==
'{') {
291static bool soap_check_zval_ref(
zval *
data, xmlNodePtr node) {
299 xmlAttrPtr
attr = node_ptr->properties;
303 if (node_ptr == node) {
315 id = (
char*)
attr->children->content;
316 smart_str_appendc(&
prefix,
'#');
317 smart_str_appends(&
prefix,
id);
322 smart_str_appendl(&
prefix,
"#ref", 4);
326 xmlSetProp(node_ptr, BAD_CAST(
"id"), BAD_CAST(
id+1));
328 xmlSetProp(node, BAD_CAST(
"href"), BAD_CAST(
id));
332 id = (
char*)
attr->children->content;
333 smart_str_appendc(&
prefix,
'#');
334 smart_str_appends(&
prefix,
id);
339 smart_str_appendl(&
prefix,
"#ref", 4);
356static bool soap_check_xml_ref(
zval *
data, xmlNodePtr node)
374static void soap_add_xml_ref(
zval *
data, xmlNodePtr node)
381static xmlNodePtr master_to_xml_int(
encodePtr encode,
zval *
data,
int style, xmlNodePtr parent,
int check_class_map)
383 xmlNodePtr node =
NULL;
412 smart_str_append(&nscat,
Z_STR_P(zns));
413 smart_str_appendc(&nscat,
':');
415 smart_str_append(&nscat,
Z_STR_P(zstype));
418 smart_str_free(&nscat);
444 xmlNodeSetName(node, BAD_CAST(
Z_STRVAL_P(zname)));
494 smart_str_appends(&nscat,
encode->details.ns);
495 smart_str_appendc(&nscat,
':');
497 smart_str_appends(&nscat,
encode->details.type_str);
502 smart_str_free(&nscat);
507 set_ns_and_type(node, &
encode->details);
516 return master_to_xml_int(
encode,
data, style, parent, 1);
522 if (
encode->details.type_str) {
527 smart_str_appends(&nscat,
encode->details.ns);
528 smart_str_appendc(&nscat,
':');
530 smart_str_appends(&nscat,
encode->details.type_str);
535 smart_str_free(&nscat);
539 if (type_attr !=
NULL) {
547 nsptr = xmlSearchNs(
data->doc,
data, BAD_CAST(ns));
549 smart_str_appends(&nscat, (
char*)nsptr->href);
550 smart_str_appendc(&nscat,
':');
552 smart_str_appends(&nscat, cptype);
558 smart_str_free(&nscat);
570 data = check_and_resolve_href(
data);
578 if (type_attr !=
NULL) {
615 if (doc && doc->children) {
616 ret = xmlDocCopyNode(doc->children, parent->doc, 1);
624 ret = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
626 xmlAddChild(parent,
ret);
640 copy = xmlCopyNode(node, 1);
641 buf = xmlBufferCreate();
668 xmlBufferPtr in = xmlBufferCreateStatic(
data->children->content, xmlStrlen(
data->children->content));
669 xmlBufferPtr
out = xmlBufferCreate();
701 xmlBufferPtr in = xmlBufferCreateStatic(
data->children->content, xmlStrlen(
data->children->content));
702 xmlBufferPtr
out = xmlBufferCreate();
734 xmlBufferPtr in = xmlBufferCreateStatic(
data->children->content, xmlStrlen(
data->children->content));
735 xmlBufferPtr
out = xmlBufferCreate();
768 str = php_base64_decode(
data->children->content,
strlen((
char*)
data->children->content));
774 str = php_base64_decode(
data->children->content,
strlen((
char*)
data->children->content));
803 str = zend_string_alloc(
strlen((
char*)
data->children->content) / 2, 0);
804 for (i =
j = 0; i <
ZSTR_LEN(str); i++) {
805 c =
data->children->content[
j++];
806 if (c >=
'0' && c <=
'9') {
808 }
else if (c >=
'a' && c <=
'f') {
809 ZSTR_VAL(str)[i] = (c -
'a' + 10) << 4;
810 }
else if (c >=
'A' && c <=
'F') {
811 ZSTR_VAL(str)[i] = (c -
'A' + 10) << 4;
815 c =
data->children->content[
j++];
816 if (c >=
'0' && c <=
'9') {
818 }
else if (c >=
'a' && c <=
'f') {
820 }
else if (c >=
'A' && c <=
'F') {
873 return zval_get_long(
data);
881 ret = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
882 xmlAddChild(parent,
ret);
886 char *str =
ZSTR_VAL(serialization);
887 size_t new_len =
ZSTR_LEN(serialization);
890 xmlBufferPtr in = xmlBufferCreateStatic(str, new_len);
891 xmlBufferPtr
out = xmlBufferCreate();
895 zend_string_release(serialization);
896 serialization =
NULL;
904 if (!php_libxml_xmlCheckUTF8(BAD_CAST(str))) {
910 for (i = 0; (c =
err[i++]);) {
911 if ((c & 0x80) == 0) {
912 }
else if ((c & 0xe0) == 0xc0) {
913 if ((
err[i] & 0xc0) != 0x80) {
917 }
else if ((c & 0xf0) == 0xe0) {
918 if ((
err[i] & 0xc0) != 0x80 || (
err[i+1] & 0xc0) != 0x80) {
922 }
else if ((c & 0xf8) == 0xf0) {
923 if ((
err[i] & 0xc0) != 0x80 || (
err[i+1] & 0xc0) != 0x80 || (
err[i+2] & 0xc0) != 0x80) {
934 err[i++] = ((
unsigned char)c >> 4) + ((((
unsigned char)c >> 4) > 9) ? (
'a' - 10) :
'0');
935 err[i++] = (c & 15) + (((c & 15) > 9) ? (
'a' - 10) :
'0');
945 text = xmlNewTextLen(BAD_CAST(str), new_len);
948 zend_string_release(serialization);
963 ret = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
964 xmlAddChild(parent,
ret);
969 zend_string_release(serialization);
983 static const char hexconvtab[] =
"0123456789ABCDEF";
989 ret = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
990 xmlAddChild(parent,
ret);
994 ZVAL_STR(&tmp, get_serialization_string_from_zval(
data));
1009 zval_ptr_dtor_str(&tmp);
1029 switch (is_numeric_string((
char*)
data->children->content,
strlen((
char*)
data->children->content), &lval, &
dval, 0)) {
1037 if (
strncasecmp((
char*)
data->children->content,
"NaN",
sizeof(
"NaN")-1) == 0) {
1039 }
else if (
strncasecmp((
char*)
data->children->content,
"INF",
sizeof(
"INF")-1) == 0) {
1041 }
else if (
strncasecmp((
char*)
data->children->content,
"-INF",
sizeof(
"-INF")-1) == 0) {
1069 switch (is_numeric_string((
char*)
data->children->content,
strlen((
char*)
data->children->content), &lval, &
dval, 0)) {
1092 ret = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
1093 xmlAddChild(parent,
ret);
1100 xmlNodeSetContent(
ret, BAD_CAST(
s));
1119 ret = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
1120 xmlAddChild(parent,
ret);
1127 xmlNodeSetContentLen(
ret, BAD_CAST(str),
strlen(str));
1144 if (
stricmp((
char*)
data->children->content,
"true") == 0 ||
1145 stricmp((
char*)
data->children->content,
"t") == 0 ||
1146 strcmp((
char*)
data->children->content,
"1") == 0) {
1148 }
else if (
stricmp((
char*)
data->children->content,
"false") == 0 ||
1149 stricmp((
char*)
data->children->content,
"f") == 0 ||
1150 strcmp((
char*)
data->children->content,
"0") == 0) {
1169 ret = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
1170 xmlAddChild(parent,
ret);
1174 xmlNodeSetContent(
ret, BAD_CAST(
"true"));
1176 xmlNodeSetContent(
ret, BAD_CAST(
"false"));
1196 ret = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
1197 xmlAddChild(parent,
ret);
1214 if (
data == &
EG(uninitialized_zval)) {
1225static void unset_zval_property(
zval*
object,
char*
name)
1234static void model_to_zval_any(
zval *
ret, xmlNodePtr node)
1240 while (node !=
NULL) {
1241 if (get_zval_property(
ret, (
char*)node->name, &
rv) ==
NULL) {
1250 add_assoc_zval(&arr,
name, any);
1252 add_next_index_zval(&arr, any);
1259 while (node->next !=
NULL) {
1273 name = (
char*)node->name;
1280 add_assoc_zval(&arr,
name, &
val);
1295 add_next_index_zval(&arr, el);
1298 add_next_index_zval(el, &
val);
1300 add_assoc_zval(any,
name, &
val);
1303 add_next_index_zval(any, &
val);
1317 switch (model->
kind) {
1327 r_node = check_and_resolve_href(node);
1328 if (r_node && r_node->children && r_node->children->content) {
1334 xmlNodePtr dummy = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
1335 xmlNodeSetContent(dummy, BAD_CAST(model->
u.
element->
fixed));
1339 xmlNodePtr dummy = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
1340 xmlNodeSetContent(dummy, BAD_CAST(model->
u.
element->
def));
1350 add_next_index_zval(&array, &
val);
1353 if (node && node->children && node->children->content) {
1359 xmlNodePtr dummy = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
1360 xmlNodeSetContent(dummy, BAD_CAST(model->
u.
element->
fixed));
1364 xmlNodePtr dummy = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
1365 xmlNodeSetContent(dummy, BAD_CAST(model->
u.
element->
def));
1371 add_next_index_zval(&array, &
val);
1380 add_next_index_zval(&array, &
val);
1401 model_to_zval_any(
ret,
data->children);
1427 if (
type->clark_notation !=
NULL) {
1430 if (classname ==
NULL) {
1433 if (classname !=
NULL &&
1456 if (soap_check_xml_ref(
ret,
data)) {
1463 master_to_zval_int(&base, enc,
data);
1464 set_zval_property(
ret,
"_", &base);
1468 if (soap_check_xml_ref(
ret,
data)) {
1479 if (
sdlType->encode->details.sdl_type &&
1485 if (soap_check_xml_ref(
ret,
data)) {
1495 (
sdlType->encode->details.sdl_type->encode ==
NULL ||
1496 (
sdlType->encode->details.sdl_type->encode->details.type !=
IS_ARRAY &&
1505 redo_any = get_zval_property(
ret,
"any", &
rv);
1514 if (soap_check_xml_ref(
ret,
data)) {
1523 set_zval_property(
ret,
"_", &base);
1528 if (soap_check_xml_ref(
ret,
data)) {
1539 if (!get_zval_property(
ret,
"any", &
rv)) {
1540 model_to_zval_any(
ret,
data->children);
1543 unset_zval_property(
ret,
"any");
1553 char *str_val =
NULL;
1555 if (
val &&
val->children &&
val->children->content) {
1556 str_val = (
char*)
val->children->content;
1558 soap_error3(
E_ERROR,
"Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)",
attr->name,
attr->fixed, str_val);
1560 }
else if (
attr->fixed) {
1561 str_val =
attr->fixed;
1562 }
else if (
attr->def) {
1563 str_val =
attr->def;
1566 xmlNodePtr dummy,
text;
1569 dummy = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
1570 text = xmlNewText(BAD_CAST(str_val));
1571 xmlAddChild(dummy,
text);
1589 if (soap_check_xml_ref(
ret,
data)) {
1597 trav =
data->children;
1599 while (trav !=
NULL) {
1607 prop = get_zval_property(
ret, (
char*)trav->name, &
rv);
1609 if (!trav->next || !
get_node(trav->next, (
char*)trav->name)) {
1610 set_zval_property(
ret, (
char*)trav->name, &tmpVal);
1615 add_next_index_zval(&arr, &tmpVal);
1616 set_zval_property(
ret, (
char*)trav->name, &arr);
1624 add_next_index_zval(&arr, prop);
1625 set_zval_property(
ret, (
char*)trav->name, &arr);
1631 add_next_index_zval(prop, &tmpVal);
1646static int model_to_xml_object(xmlNodePtr node,
sdlContentModelPtr model,
zval *
object,
int style,
int strict)
1648 switch (model->
kind) {
1674 property = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
1694 property = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
1741 data = get_zval_property(
object,
"any", &
rv);
1772 if (!model_to_xml_object(node, tmp,
object, style, strict && (tmp->
min_occurs > 0))) {
1786 int tmp_ret = model_to_xml_object(node, tmp,
object, style, 0);
1789 }
else if (tmp_ret != 0) {
1796 return model_to_xml_object(node, model->
u.
group->
model,
object, style, strict && model->
min_occurs > 0);
1806 switch (model->
kind) {
1819 if (zend_hash_num_elements(model->
u.
content) != 1) {
1823 return model_array_element(tmp);
1829 return model_array_element(model->
u.
group->
model);
1839 xmlNodePtr xmlParam;
1844 xmlParam = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
1845 xmlAddChild(parent, xmlParam);
1847 set_xsi_nil(xmlParam);
1848 set_ns_and_type(xmlParam,
type);
1873 zval *tmp = get_zval_property(
data,
"_", &
rv);
1876 }
else if (prop ==
NULL) {
1879 xmlParam = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
1880 xmlAddChild(parent, xmlParam);
1883 xmlParam = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
1884 xmlAddChild(parent, xmlParam);
1888 if (
sdlType->encode->details.sdl_type &&
1898 zval *tmp = get_zval_property(
data,
"_", &
rv);
1902 }
else if (prop ==
NULL) {
1905 xmlParam = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
1906 xmlAddChild(parent, xmlParam);
1910 xmlParam = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
1911 xmlAddChild(parent, xmlParam);
1914 if (soap_check_zval_ref(
data, xmlParam)) {
1924 (array_el = model_array_element(
sdlType->model)) !=
NULL) {
1931 property = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
1946 model_to_xml_object(xmlParam,
sdlType->model,
data, style, 1);
1954 zattr = get_zval_property(
data,
attr->name, &
rv);
1959 if (dummy->children && dummy->children->content) {
1960 if (
attr->fixed &&
strcmp(
attr->fixed, (
char*)dummy->children->content) != 0) {
1961 soap_error3(
E_ERROR,
"Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)",
attr->name,
attr->fixed, dummy->children->content);
1971 xmlSetNsProp(xmlParam, nsp, BAD_CAST(
attr->name), dummy->children->content);
1973 xmlSetProp(xmlParam, BAD_CAST(
attr->name), dummy->children->content);
1976 xmlUnlinkNode(dummy);
1984 set_ns_and_type(xmlParam,
type);
1987 xmlParam = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
1988 xmlAddChild(parent, xmlParam);
1990 if (soap_check_zval_ref(
data, xmlParam)) {
2003 const char *prop_name;
2006 const char *class_name;
2013 xmlNodeSetName(
property, BAD_CAST(prop_name));
2019 set_ns_and_type(xmlParam,
type);
2044static int calc_dimension_12(
const char* str)
2046 int i = 0, flag = 0;
2047 while (*str !=
'\0' && (*str <
'0' || *str >
'9') && (*str !=
'*')) {
2054 while (*str !=
'\0') {
2055 if (*str >=
'0' && *str <=
'9') {
2060 }
else if (*str ==
'*') {
2070static int* get_position_12(
int dimension,
const char* str)
2073 int i = -1, flag = 0;
2077 while (*str !=
'\0' && (*str <
'0' || *str >
'9') && (*str !=
'*')) {
2084 while (*str !=
'\0') {
2085 if (*str >=
'0' && *str <=
'9') {
2090 pos[i] = (
pos[i]*10)+(*str-
'0');
2091 }
else if (*str ==
'*') {
2101static int calc_dimension(
const char* str)
2104 while (*str !=
']' && *str !=
'\0') {
2113static void get_position_ex(
int dimension,
const char* str,
int**
pos)
2118 while (*str !=
']' && *str !=
'\0' && i < dimension) {
2119 if (*str >=
'0' && *str <=
'9') {
2120 (*pos)[i] = ((*pos)[i]*10)+(*str-
'0');
2121 }
else if (*str ==
',') {
2128static int* get_position(
int dimension,
const char* str)
2133 get_position_ex(dimension, str, &
pos);
2137static void add_xml_array_elements(xmlNodePtr xmlParam,
2164 if (dimension == 1) {
2172 xmlNodeSetName(xparam, BAD_CAST(
type->name));
2175 xmlSetNs(xparam, ns);
2177 xmlNodeSetName(xparam, BAD_CAST(
"item"));
2180 add_xml_array_elements(xmlParam,
type, enc, ns, dimension-1,
dims+1, zdata, style);
2185 if (dimension == 1) {
2186 while (
j <
dims[0]) {
2187 xparam = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
2188 xmlAddChild(xmlParam, xparam);
2191 xmlNodeSetName(xparam, BAD_CAST(
type->name));
2194 xmlSetNs(xparam, ns);
2196 xmlNodeSetName(xparam, BAD_CAST(
"item"));
2202 while (
j <
dims[0]) {
2203 add_xml_array_elements(xmlParam,
type, enc, ns, dimension-1,
dims+1,
NULL, style);
2211 if (dimension == 1) {
2214 xparam = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
2215 xmlAddChild(xmlParam, xparam);
2217 xmlNodeSetName(xparam, BAD_CAST(
type->name));
2220 xmlSetNs(xparam, ns);
2222 xmlNodeSetName(xparam, BAD_CAST(
"item"));
2225 add_xml_array_elements(xmlParam,
type, enc, ns, dimension-1,
dims+1,
NULL, style);
2235 smart_str array_type = {0}, array_size = {0};
2237 xmlNodePtr xmlParam;
2247 xmlParam = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
2248 xmlAddChild(parent, xmlParam);
2252 set_xsi_nil(xmlParam);
2256 set_ns_and_type(xmlParam,
type);
2272 goto iterator_failed_to_get;
2301 add_next_index_zval(&array_copy,
val);
2312iterator_failed_to_get:
2343 dimension = calc_dimension(
end);
2347 get_type_str(xmlParam,
ext->ns,
value, &array_type);
2349 smart_str_appends(&array_type,
value);
2355 for (i = 1; i < dimension; i++) {
2357 zend_hash_num_elements(
Z_ARRVAL_P(el)) > 0) {
2370 smart_str_append_long(&array_size,
dims[0]);
2371 for (i=1; i<dimension; i++) {
2372 smart_str_appendc(&array_size,
',');
2373 smart_str_append_long(&array_size,
dims[i]);
2378 }
else if (sdl_type &&
2386 get_type_str(xmlParam,
ext->ns,
ext->val, &array_type);
2388 smart_str_appends(&array_type,
ext->val);
2394 dimension = calc_dimension_12(
ext->val);
2395 dims = get_position_12(dimension,
ext->val);
2398 smart_str_append_long(&array_size,
dims[0]);
2399 for (i=1; i<dimension; i++) {
2400 smart_str_appendc(&array_size,
',');
2401 smart_str_append_long(&array_size,
dims[i]);
2406 smart_str_append_long(&array_size, i);
2408 }
else if (sdl_type &&
2414 dimension = calc_dimension_12(
ext->val);
2415 dims = get_position_12(dimension,
ext->val);
2418 smart_str_append_long(&array_size,
dims[0]);
2419 for (i=1; i<dimension; i++) {
2420 smart_str_appendc(&array_size,
',');
2421 smart_str_append_long(&array_size,
dims[i]);
2424 if (sdl_type && sdl_type->
elements &&
2425 zend_hash_num_elements(sdl_type->
elements) == 1 &&
2426 (zend_hash_internal_pointer_reset(sdl_type->
elements),
2429 element_type = elementType;
2430 enc = elementType->
encode;
2433 enc = get_array_type(xmlParam,
data, &array_type);
2435 }
else if (sdl_type && sdl_type->
elements &&
2436 zend_hash_num_elements(sdl_type->
elements) == 1 &&
2437 (zend_hash_internal_pointer_reset(sdl_type->
elements),
2441 element_type = elementType;
2442 enc = elementType->
encode;
2445 smart_str_append_long(&array_size, i);
2451 enc = get_array_type(xmlParam,
data, &array_type);
2452 smart_str_append_long(&array_size, i);
2459 smart_str_0(&array_type);
2460#if defined(__GNUC__) && __GNUC__ >= 11
2463 bool is_xsd_any_type =
strcmp(
ZSTR_VAL(array_type.
s),
"xsd:anyType") == 0;
2464#if defined(__GNUC__) && __GNUC__ >= 11
2467 if (is_xsd_any_type) {
2468 smart_str_free(&array_type);
2469 smart_str_appendl(&array_type,
"xsd:ur-type",
sizeof(
"xsd:ur-type")-1);
2471 smart_str_appendc(&array_type,
'[');
2472 smart_str_append_smart_str(&array_type, &array_size);
2473 smart_str_appendc(&array_type,
']');
2474 smart_str_0(&array_type);
2478 while (i <
ZSTR_LEN(array_size.s)) {
2482 smart_str_0(&array_type);
2483 smart_str_0(&array_size);
2488 smart_str_free(&array_type);
2489 smart_str_free(&array_size);
2498 set_ns_and_type(xmlParam,
type);
2524 attr->children &&
attr->children->content) {
2530 nsptr = xmlSearchNs(
attr->doc,
attr->parent, BAD_CAST(ns));
2535 dimension = calc_dimension(
end+1);
2536 dims = get_position(dimension,
end+1);
2538 if (nsptr !=
NULL) {
2541 if (ns) {
efree(ns);}
2545 attr->children->content) {
2551 nsptr = xmlSearchNs(
attr->doc,
attr->parent, BAD_CAST(ns));
2552 if (nsptr !=
NULL) {
2555 if (ns) {
efree(ns);}
2558 attr->children &&
attr->children->content) {
2559 dimension = calc_dimension_12((
char*)
attr->children->content);
2560 dims = get_position_12(dimension, (
char*)
attr->children->content);
2567 attr->children &&
attr->children->content) {
2569 dimension = calc_dimension_12((
char*)
attr->children->content);
2570 dims = get_position_12(dimension, (
char*)
attr->children->content);
2572 }
else if (
type->sdl_type !=
NULL &&
2573 type->sdl_type->attributes !=
NULL &&
2593 }
else if (
type->sdl_type !=
NULL &&
2594 type->sdl_type->attributes !=
NULL &&
2608 dimension = calc_dimension_12(
ext->val);
2609 dims = get_position_12(dimension,
ext->val);
2614 }
else if (
type->sdl_type !=
NULL &&
2615 type->sdl_type->attributes !=
NULL &&
2621 dimension = calc_dimension_12(
ext->val);
2622 dims = get_position_12(dimension,
ext->val);
2623 if (
type->sdl_type &&
type->sdl_type->elements &&
2624 zend_hash_num_elements(
type->sdl_type->elements) == 1 &&
2625 (zend_hash_internal_pointer_reset(
type->sdl_type->elements),
2628 enc = elementType->
encode;
2630 }
else if (
type->sdl_type &&
type->sdl_type->elements &&
2631 zend_hash_num_elements(
type->sdl_type->elements) == 1 &&
2632 (zend_hash_internal_pointer_reset(
type->sdl_type->elements),
2635 enc = elementType->
encode;
2646 attr->children &&
attr->children->content) {
2647 char* tmp =
strrchr((
char*)
attr->children->content,
'[');
2650 tmp = (
char*)
attr->children->content;
2652 get_position_ex(dimension, tmp, &
pos);
2656 trav =
data->children;
2661 xmlAttrPtr position =
get_attribute(trav->properties,
"position");
2665 if (position !=
NULL && position->children && position->children->content) {
2666 char* tmp =
strrchr((
char*)position->children->content,
'[');
2668 tmp = (
char*)position->children->content;
2670 get_position_ex(dimension, tmp, &
pos);
2676 while (i < dimension-1) {
2718 xmlNodePtr xmlParam;
2719 xmlNodePtr xparam, item;
2722 xmlParam = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
2723 xmlAddChild(parent, xmlParam);
2735 item = xmlNewNode(
NULL, BAD_CAST(
"item"));
2736 xmlAddChild(xmlParam, item);
2737 key = xmlNewNode(
NULL, BAD_CAST(
"key"));
2738 xmlAddChild(item,
key);
2741 set_xsi_type(
key,
"xsd:string");
2743 xmlNodeSetContent(
key, BAD_CAST(
ZSTR_VAL(key_val)));
2746 smart_str_append_long(&tmp, int_val);
2750 set_xsi_type(
key,
"xsd:int");
2754 smart_str_free(&tmp);
2759 xmlNodeSetName(xparam, BAD_CAST(
"value"));
2765 set_ns_and_type(xmlParam,
type);
2774 xmlNodePtr trav, item, xmlKey, xmlValue;
2781 trav =
data->children;
2783 trav =
data->children;
2785 xmlKey =
get_node(item->children,
"key");
2790 xmlValue =
get_node(item->children,
"value");
2805 soap_error0(
E_ERROR,
"Encoding: Can't decode apache map, only Strings or Longs are allowed as keys");
2827 ret = master_to_xml_int(enc,
data, style, parent, 0);
2840 xmlChar *type_name =
NULL;
2842 data = check_and_resolve_href(
data);
2850 if (tmpattr !=
NULL) {
2851 type_name = tmpattr->children->content;
2882 trav =
data->children;
2883 while (trav !=
NULL) {
2893 master_to_zval_int(
ret, enc,
data);
2904 nsptr = xmlSearchNs(
data->doc,
data, BAD_CAST(ns));
2909 if (ns) {
efree(ns);}
2916static xmlNodePtr to_xml_datetime_ex(
encodeTypePtr type,
zval *
data,
char *format,
const char *ext_date_format,
size_t ext_date_format_len,
int style, xmlNodePtr parent)
2919 struct tm *ta, tmbuf;
2921 int max_reallocs = 5;
2922 size_t buf_len=64, real_len;
2926 xmlNodePtr xmlParam;
2928 xmlParam = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
2929 xmlAddChild(parent, xmlParam);
2941 while ((real_len =
strftime(
buf, buf_len, format, ta)) == buf_len || real_len == 0) {
2944 if (!--max_reallocs)
break;
2948#ifdef HAVE_STRUCT_TM_TM_GMTOFF
2949 snprintf(tzbuf,
sizeof(tzbuf),
"%c%02ld:%02ld",
2950 (ta->tm_gmtoff < 0) ?
'-' :
'+',
2951 labs(ta->tm_gmtoff / 3600), labs( (ta->tm_gmtoff % 3600) / 60 ));
2953# if defined(__CYGWIN__) || (defined(PHP_WIN32) && defined(_MSC_VER) && _MSC_VER >= 1900)
2954 snprintf(tzbuf,
sizeof(tzbuf),
"%c%02d:%02d", ((ta->tm_isdst ? _timezone - 3600:_timezone)>0)?
'-':
'+',
abs((ta->tm_isdst ? _timezone - 3600 : _timezone) / 3600),
abs(((ta->tm_isdst ? _timezone - 3600 : _timezone) % 3600) / 60));
2959 if (
strcmp(tzbuf,
"+00:00") == 0) {
2965 if (real_len >= buf_len) {
2970 xmlNodeSetContent(xmlParam, BAD_CAST(
buf));
2978 if (formatted_date_string) {
2979 xmlNodeSetContentLen(xmlParam, BAD_CAST(
ZSTR_VAL(formatted_date_string)),
ZSTR_LEN(formatted_date_string));
2988 set_ns_and_type(xmlParam,
type);
2996 return to_xml_string(
type,
data, style, parent);
2999#define TO_XML_DATETIME_EX_HELPER(type, date, format, ext_date_format, style, parent) \
3000 to_xml_datetime_ex(type, data, format, ext_date_format, strlen(ext_date_format), style, parent)
3044 return to_zval_stringc(
ret, enc,
data);
3055 list_enc =
type->encode;
3060 ret = xmlNewNode(
NULL, BAD_CAST(
"BOGUS"));
3061 xmlAddChild(parent,
ret);
3070 if (dummy && dummy->children && dummy->children->content) {
3072 smart_str_appendc(&list,
' ');
3074 smart_str_appends(&list, (
char*)dummy->children->content);
3078 xmlUnlinkNode(dummy);
3085 xmlNodeSetContentLen(
ret, BAD_CAST(
""), 0);
3087 smart_str_free(&list);
3094 ZVAL_STR(&tmp, get_serialization_string_from_zval(
data));
3112 if (dummy && dummy->children && dummy->children->content) {
3114 smart_str_appendc(&list,
' ');
3116 smart_str_appends(&list, (
char*)dummy->children->content);
3120 xmlUnlinkNode(dummy);
3129 xmlNodeSetContentLen(
ret, BAD_CAST(
""), 0);
3131 smart_str_free(&list);
3134 zval_ptr_dtor_str(&tmp);
3142 return to_xml_list(enc,
data,style, parent);
3147 return to_zval_list(
ret, enc,
data);
3152 return to_xml_list(enc,
data,style, parent);
3164 smart_str_appends(&nscat, (
char*)
data->ns->href);
3165 smart_str_appendc(&nscat,
':');
3167 smart_str_appends(&nscat, (
char*)
data->name);
3168 smart_str_0(&nscat);
3172 smart_str_free(&nscat);
3175 smart_str_free(&nscat);
3178 buf = xmlBufferCreate();
3197 ret->name != xmlStringTextNoenc) {
3204 zend_string *serialization = get_serialization_string_from_zval(
data);
3208 ret->name = xmlStringTextNoenc;
3209 ret->parent = parent;
3210 ret->doc = parent->doc;
3211 ret->prev = parent->last;
3214 parent->last->next =
ret;
3216 parent->children =
ret;
3229 return guess_zval_convert(
ret, enc,
data);
3260 switch (
type->kind) {
3262 if (
type->encode && enc != &
type->encode->details) {
3263 return master_to_zval_int(
ret,
type->encode,
data);
3265 return guess_zval_convert(
ret, enc,
data);
3269 return to_zval_list(
ret, enc,
data);
3271 return to_zval_union(
ret, enc,
data);
3278 return to_zval_array(
ret, enc,
data);
3280 return to_zval_object(
ret, enc,
data);
3283 return guess_zval_convert(
ret, enc,
data);
3295 ret = guess_xml_convert(enc,
data, style, parent);
3297 set_ns_and_type(
ret, enc);
3324 switch(
type->kind) {
3326 if (
type->encode && enc != &
type->encode->details) {
3329 ret = guess_xml_convert(enc,
data, style, parent);
3333 ret = to_xml_list(enc,
data, style, parent);
3336 ret = to_xml_union(enc,
data, style, parent);
3344 return to_xml_array(enc,
data, style, parent);
3346 return to_xml_object(enc,
data, style, parent);
3354 set_ns_and_type(
ret, enc);
3359static xmlNodePtr check_and_resolve_href(xmlNodePtr
data)
3364 href =
data->properties;
3367 if (href ==
NULL || href->ns ==
NULL) {
break;}
3372 if (href->children->content[0] ==
'#') {
3375 soap_error1(
E_ERROR,
"Encoding: Unresolved reference '%s'", href->children->content);
3389 if (href->children->content[0] ==
'#') {
3390 id = href->children->content+1;
3392 id = href->children->content;
3396 soap_error1(
E_ERROR,
"Encoding: Unresolved reference '%s'", href->children->content);
3398 soap_error1(
E_ERROR,
"Encoding: Violation of id and ref information items '%s'", href->children->content);
3408 set_ns_and_type_ex(node,
type->ns,
type->type_str);
3411static void set_ns_and_type_ex(xmlNodePtr node,
char *ns,
char *
type)
3414 get_type_str(node, ns,
type, &nstype);
3416 smart_str_free(&nstype);
3419static xmlNsPtr xmlSearchNsPrefixByHref(xmlDocPtr doc, xmlNodePtr node,
const xmlChar * href)
3422 xmlNodePtr orig = node;
3427 node->type == XML_ENTITY_DECL) {
3432 while (cur !=
NULL) {
3433 if (cur->prefix && cur->href && xmlStrEqual(cur->href, href)) {
3434 if (xmlSearchNs(doc, node, cur->prefix) == cur) {
3443 if (cur->prefix && cur->href && xmlStrEqual(cur->href, href)) {
3444 if (xmlSearchNs(doc, node, cur->prefix) == cur) {
3451 node = node->parent;
3464 xmlns = xmlSearchNsByHref(node->doc, node, BAD_CAST(ns));
3465 if (xmlns !=
NULL && xmlns->prefix ==
NULL) {
3466 xmlns = xmlSearchNsPrefixByHref(node->doc, node, BAD_CAST(ns));
3468 if (xmlns ==
NULL) {
3472 xmlns = xmlNewNs(node->doc->children, BAD_CAST(ns),
prefix);
3478 smart_str_appendl(&
prefix,
"ns", 2);
3479 smart_str_append_long(&
prefix, num);
3491#if LIBXML_VERSION < 21300
3492 xmlChar *enc_ns = xmlEncodeSpecialChars(node->doc, BAD_CAST(ns));
3496 xmlns = xmlNewNs(node->doc->children, BAD_CAST(ns), BAD_CAST(
prefix.s ?
ZSTR_VAL(
prefix.s) :
""));
3504static void set_ns_prop(xmlNodePtr node,
char *ns,
char *
name,
char *
val)
3509static void set_xsi_nil(xmlNodePtr node)
3514static void set_xsi_type(xmlNodePtr node,
char *
type)
3554static int is_map(
zval *array)
3565 if (
key || index != i) {
3576 int i, cur_type, prev_type, different;
3578 char *prev_stype =
NULL, *cur_stype =
NULL, *prev_ns =
NULL, *cur_ns =
NULL;
3581 smart_str_appendl(
type,
"xsd:anyType",
sizeof(
"xsd:anyType")-1);
3587 cur_type = prev_type = 0;
3625 if ((cur_type != prev_type) ||
3626 (cur_stype !=
NULL && prev_stype !=
NULL &&
strcmp(cur_stype,prev_stype) != 0) ||
3627 (cur_stype ==
NULL && cur_stype != prev_stype) ||
3628 (cur_ns !=
NULL && prev_ns !=
NULL &&
strcmp(cur_ns,prev_ns) != 0) ||
3629 (cur_ns ==
NULL && cur_ns != prev_ns)) {
3635 prev_type = cur_type;
3636 prev_stype = cur_stype;
3641 if (different || i == 0) {
3642 smart_str_appendl(
type,
"xsd:anyType",
sizeof(
"xsd:anyType")-1);
3647 if (cur_stype !=
NULL) {
3653 smart_str_appends(
type, (
char*)ns->prefix);
3654 smart_str_appendc(
type,
':');
3655 smart_str_appends(&array_type, cur_ns);
3656 smart_str_appendc(&array_type,
':');
3658 smart_str_appends(
type, cur_stype);
3660 smart_str_appends(&array_type, cur_stype);
3661 smart_str_0(&array_type);
3664 smart_str_free(&array_type);
3675static void get_type_str(xmlNodePtr node,
const char* ns,
const char*
type,
smart_str*
ret)
3688 smart_str_appends(
ret, (
char*)xmlns->prefix);
3689 smart_str_appendc(
ret,
':');
3695static void delete_mapping(
void *
data)
file_private const char ext[]
PHPAPI double php_get_nan(void)
PHPAPI double php_get_inf(void)
copy(string $from, string $to, $context=null)
strrchr(string $haystack, string $needle, bool $before_needle=false)
assert(mixed $assertion, Throwable|string|null $description=null)
strchr(string $haystack, string $needle, bool $before_needle=false)
memset(ptr, 0, type->size)
zend_ffi_ctype_name_buf buf
PHPAPI zend_class_entry * php_date_get_interface_ce(void)
PHPAPI zend_string * php_format_date_obj(const char *format, size_t format_len, php_date_obj *date_obj)
struct _php_date_obj php_date_obj
strftime(string $format, ?int $timestamp=null)
const XML_CDATA_SECTION_NODE
const XML_ENTITY_REF_NODE
encodePtr get_conversion(int encode)
void whiteSpace_collapse(xmlChar *str)
void delete_encoder(zval *zv)
void delete_encoder_persistent(zval *zv)
xmlNodePtr to_xml_user(encodeTypePtr type, zval *data, int style, xmlNodePtr parent)
zval * to_zval_user(zval *ret, encodeTypePtr type, xmlNodePtr node)
#define CHECK_XML_NULL(xml)
#define FIND_XML_NULL(xml, zval)
xmlNsPtr encode_add_ns(xmlNodePtr node, const char *ns)
xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr parent)
zval * master_to_zval(zval *ret, encodePtr encode, xmlNodePtr data)
void whiteSpace_replace(xmlChar *str)
xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNodePtr parent)
#define FIND_ZVAL_NULL(zval, xml, style)
zval * sdl_guess_convert_zval(zval *ret, encodeTypePtr enc, xmlNodePtr data)
#define TO_XML_DATETIME_EX_HELPER(type, date, format, ext_date_format, style, parent)
void encode_reset_ns(void)
#define Z_VAR_ENC_NS_P(zv)
#define XSD_UNSIGNEDLONG_STRING
#define XSD_POSITIVEINTEGER_STRING
#define XSD_STRING_STRING
#define SOAP_ENC_OBJECT_STRING
#define Z_VAR_ENC_NAMENS_P(zv)
#define Z_VAR_ENC_VALUE_P(zv)
#define XSD_NMTOKEN_STRING
#define XSD_UNSIGNEDINT_STRING
#define XSD_ENTITY_STRING
#define XSD_NONPOSITIVEINTEGER_STRING
#define XSD_LANGUAGE_STRING
#define XSD_ENTITIES_STRING
#define XSD_1999_TIMEINSTANT_STRING
#define XSD_UNSIGNEDSHORT
#define XSD_INTEGER_STRING
#define XSD_NCNAME_STRING
#define XSD_NONNEGATIVEINTEGER_STRING
#define APACHE_MAP_STRING
#define XSD_NEGATIVEINTEGER_STRING
#define XSD_GMONTHDAY_STRING
#define XSD_DOUBLE_STRING
#define XSD_ANYURI_STRING
#define XSD_POSITIVEINTEGER
#define XSD_IDREFS_STRING
#define XSD_NOTATION_STRING
#define Z_VAR_ENC_STYPE_P(zv)
#define XSD_NONNEGATIVEINTEGER
#define XSD_DURATION_STRING
#define XSD_UNSIGNEDSHORT_STRING
#define Z_VAR_ENC_NAME_P(zv)
#define XSD_UNSIGNEDBYTE_STRING
#define XSD_GMONTH_STRING
#define XSD_BASE64BINARY_STRING
#define XSD_NMTOKENS_STRING
#define SOAP_1_1_ENC_NAMESPACE
#define XSD_1999_TIMEINSTANT
#define SOAP_ENC_ARRAY_STRING
#define XSD_GYEARMONTH_STRING
#define XSD_NORMALIZEDSTRING_STRING
#define XSD_UR_TYPE_STRING
#define Z_VAR_ENC_TYPE_P(zv)
#define XSD_NONPOSITIVEINTEGER
#define XSD_1999_NAMESPACE
#define XSD_BOOLEAN_STRING
#define XSD_HEXBINARY_STRING
#define XSD_DATETIME_STRING
#define XSD_NEGATIVEINTEGER
#define XSD_NORMALIZEDSTRING
#define SOAP_1_2_ENC_NAMESPACE
#define XSD_ANYTYPE_STRING
#define XSD_DECIMAL_STRING
unsigned const char * end
unsigned const char * pos
unsigned const char * text
PHPAPI struct tm * php_localtime_r(const time_t *const timep, struct tm *p_tm)
unsigned char key[REFLECTION_KEY_LEN]
encodePtr get_encoder_ex(sdlPtr sdl, const char *nscat, size_t len)
encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type)
encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr node, const xmlChar *type)
struct _sdlContentModel * sdlContentModelPtr
@ XSD_TYPEKIND_RESTRICTION
struct _sdlExtraAttribute * sdlExtraAttributePtr
struct _encode * encodePtr
struct _encodeType * encodeTypePtr
zend_class_entry * soap_var_class_entry
#define soap_error1(severity, format, param1)
#define SOAP_SINGLE_ELEMENT_ARRAYS
xmlCharEncodingHandlerPtr encoding
struct _sdlType * sdlTypePtr
struct _soapMapping * soapMappingPtr
#define SOAP_USE_XSI_ARRAY_TYPE
#define soap_error0(severity, format)
struct _sdlAttribute * sdlAttributePtr
#define soap_error3(severity, format, param1, param2, param3)
void parse_namespace(const xmlChar *inval, const char **value, char **namespace)
xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size)
xmlNodePtr get_node_with_attribute_recursive_ex(xmlNodePtr node, char *name, char *name_ns, char *attribute, char *value, char *attr_ns)
xmlAttrPtr get_attribute_ex(xmlAttrPtr node, char *name, char *ns)
#define get_node_with_attribute_recursive(node, name, attr, val)
#define FOREACHNODE(n, c, i)
#define get_attribute(node, name)
#define get_node(node, name)
zend_string * clark_notation
HashTable * extraAttributes
union _sdlContentModel::@136103057302222375117000326337202052042061025370 u
zend_object_iterator *(* get_iterator)(zend_class_entry *ce, zval *object, int by_ref)
void(* get_current_key)(zend_object_iterator *iter, zval *key)
void(* rewind)(zend_object_iterator *iter)
void(* move_forward)(zend_object_iterator *iter)
zend_result(* valid)(zend_object_iterator *iter)
zval *(* get_current_data)(zend_object_iterator *iter)
const zend_object_iterator_funcs * funcs
ZEND_API ZEND_COLD void zend_value_error(const char *format,...)
#define ZEND_STANDARD_CLASS_DEF_PTR
ZEND_API zend_result array_set_zval_key(HashTable *ht, zval *key, zval *value)
ZEND_API zend_result object_init_ex(zval *arg, zend_class_entry *class_type)
ZEND_API zval * zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, bool silent, zval *rv)
ZEND_API void zend_unset_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length)
ZEND_API void zend_update_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zval *value)
#define ZVAL_STRING(z, s)
#define call_user_function(function_table, object, function_name, retval_ptr, param_count, params)
#define ZVAL_EMPTY_STRING(z)
#define estrndup(s, length)
#define erealloc(ptr, size)
#define safe_emalloc(nmemb, size, offset)
strncmp(string $string1, string $string2, int $length)
strcmp(string $string1, string $string2)
zend_string_release_ex(func->internal_function.function_name, 0)
#define ZEND_FETCH_CLASS_AUTO
#define zend_unmangle_property_name(mangled_property, class_name, prop_name)
#define strncasecmp(s1, s2, n)
ZEND_API zend_class_entry * zend_fetch_class(zend_string *class_name, uint32_t fetch_type)
ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht)
ZEND_API zval *ZEND_FASTCALL zend_hash_str_find(const HashTable *ht, const char *str, size_t len)
ZEND_API zval *ZEND_FASTCALL zend_hash_index_update(HashTable *ht, zend_ulong h, zval *pData)
ZEND_API zend_result ZEND_FASTCALL zend_hash_str_del(HashTable *ht, const char *str, size_t len)
ZEND_API zval *ZEND_FASTCALL zend_hash_index_find(const HashTable *ht, zend_ulong h)
#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent)
#define HT_IS_WITHOUT_HOLES(ht)
#define ZEND_HASH_FOREACH_STR_KEY_VAL_IND(ht, _key, _val)
#define ZEND_HASH_FOREACH_KEY(ht, _h, _key)
#define ZEND_HASH_FOREACH_PTR(ht, _ptr)
#define ZEND_HASH_FOREACH_STR_KEY_VAL(ht, _key, _val)
#define zend_hash_get_current_data_ptr(ht)
#define ZEND_HASH_FOREACH_VAL_IND(ht, _val)
#define ZEND_HASH_FOREACH_END()
#define ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(ht, _key, _val)
#define ZEND_HASH_FOREACH_VAL(ht, _val)
#define ZEND_HASH_FOREACH_KEY_VAL_IND(ht, _h, _key, _val)
ZEND_API zend_class_entry * zend_ce_traversable
struct _zend_object_iterator zend_object_iterator
struct _zend_string zend_string
ZEND_API zend_string *ZEND_FASTCALL zend_long_to_str(zend_long num)
ZEND_API void ZEND_FASTCALL convert_to_boolean(zval *op)
ZEND_API bool ZEND_FASTCALL instanceof_function_slow(const zend_class_entry *instance_ce, const zend_class_entry *ce)
ZEND_API zend_result ZEND_FASTCALL concat_function(zval *result, zval *op1, zval *op2)
ZEND_API bool ZEND_FASTCALL zend_is_true(const zval *op)
ZEND_API zend_string *ZEND_FASTCALL zval_get_string_func(zval *op)
ZEND_API int ZEND_FASTCALL zend_binary_strncasecmp(const char *s1, size_t len1, const char *s2, size_t len2, size_t length)
#define MAX_LENGTH_OF_DOUBLE
#define ZEND_DIAGNOSTIC_IGNORED_END
#define ZEND_DIAGNOSTIC_IGNORED_START(warning)
#define UNEXPECTED(condition)
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object
ZEND_API zend_string * zend_empty_string
ZEND_API char * zend_gcvt(double value, int ndigit, char dec_point, char exponent, char *buf)
#define Z_TRY_ADDREF_P(pz)
#define Z_STRVAL_P(zval_p)
#define Z_ARRVAL_P(zval_p)
#define Z_REFCOUNTED_P(zval_p)
struct _zend_array HashTable
#define Z_COUNTED_P(zval_p)
#define Z_STRLEN_P(zval_p)
#define GC_TRY_UNPROTECT_RECURSION(p)
#define Z_OBJCE_P(zval_p)
#define GC_TRY_PROTECT_RECURSION(p)
#define ZVAL_NEW_STR(z, s)
#define Z_OBJPROP_P(zval_p)
#define ZVAL_DOUBLE(z, d)
#define SEPARATE_ARRAY(zv)
#define GC_IS_RECURSIVE(p)
#define ZVAL_COPY_VALUE(z, v)
#define Z_IS_RECURSIVE_P(zv)
#define Z_TRY_DELREF_P(pz)
ZEND_API void zval_ptr_dtor(zval *zval_ptr)