php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
xpath.c
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | Copyright (c) The PHP Group |
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.01 of the PHP license, |
6 | that is bundled with this package in the file LICENSE, and is |
7 | available through the world-wide-web at the following url: |
8 | https://www.php.net/license/3_01.txt |
9 | If you did not receive a copy of the PHP license and are unable to |
10 | obtain it through the world-wide-web, please send a note to |
11 | license@php.net so we can mail you a copy immediately. |
12 +----------------------------------------------------------------------+
13 | Authors: Christian Stocker <chregu@php.net> |
14 | Rob Richards <rrichards@php.net> |
15 +----------------------------------------------------------------------+
16*/
17
18#ifdef HAVE_CONFIG_H
19#include <config.h>
20#endif
21
22#include "php.h"
23#if defined(HAVE_LIBXML) && defined(HAVE_DOM)
24#include "php_dom.h"
25#include "namespace_compat.h"
26#include "private_data.h"
27
28#define PHP_DOM_XPATH_QUERY 0
29#define PHP_DOM_XPATH_EVALUATE 1
30
31/*
32* class DOMXPath
33*/
34
35#ifdef LIBXML_XPATH_ENABLED
36
37void dom_xpath_objects_free_storage(zend_object *object)
38{
39 dom_xpath_object *intern = php_xpath_obj_from_obj(object);
40
42
43 if (intern->dom.ptr != NULL) {
44 xmlXPathFreeContext((xmlXPathContextPtr) intern->dom.ptr);
45 php_libxml_decrement_doc_ref((php_libxml_node_object *) &intern->dom);
46 }
47
49}
50
51HashTable *dom_xpath_get_gc(zend_object *object, zval **table, int *n)
52{
53 dom_xpath_object *intern = php_xpath_obj_from_obj(object);
55}
56
57static void dom_xpath_proxy_factory(xmlNodePtr node, zval *child, dom_object *intern, xmlXPathParserContextPtr ctxt)
58{
60
61 ZEND_ASSERT(node->type != XML_NAMESPACE_DECL);
62
63 php_dom_create_object(node, child, intern);
64}
65
66static dom_xpath_object *dom_xpath_ext_fetch_intern(xmlXPathParserContextPtr ctxt)
67{
69 xmlGenericError(xmlGenericErrorContext,
70 "xmlExtFunctionTest: Function called from outside of PHP\n");
71 return NULL;
72 }
73
74 dom_xpath_object *intern = (dom_xpath_object *) ctxt->context->userData;
75 if (UNEXPECTED(intern == NULL)) {
76 xmlGenericError(xmlGenericErrorContext,
77 "xmlExtFunctionTest: failed to get the internal object\n");
78 return NULL;
79 }
80
81 return intern;
82}
83
84static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, php_dom_xpath_nodeset_evaluation_mode evaluation_mode) /* {{{ */
85{
86 dom_xpath_object *intern = dom_xpath_ext_fetch_intern(ctxt);
87 if (!intern) {
89 } else {
90 php_dom_xpath_callbacks_call_php_ns(&intern->xpath_callbacks, ctxt, nargs, evaluation_mode, &intern->dom, dom_xpath_proxy_factory);
91 }
92}
93/* }}} */
94
95static void dom_xpath_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs) /* {{{ */
96{
97 dom_xpath_ext_function_php(ctxt, nargs, PHP_DOM_XPATH_EVALUATE_NODESET_TO_STRING);
98}
99/* }}} */
100
101static void dom_xpath_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs) /* {{{ */
102{
103 dom_xpath_ext_function_php(ctxt, nargs, PHP_DOM_XPATH_EVALUATE_NODESET_TO_NODESET);
104}
105/* }}} */
106
107static void dom_xpath_ext_function_trampoline(xmlXPathParserContextPtr ctxt, int nargs)
108{
109 dom_xpath_object *intern = dom_xpath_ext_fetch_intern(ctxt);
110 if (!intern) {
112 } else {
113 php_dom_xpath_callbacks_call_custom_ns(&intern->xpath_callbacks, ctxt, nargs, PHP_DOM_XPATH_EVALUATE_NODESET_TO_NODESET, &intern->dom, dom_xpath_proxy_factory);
114 }
115}
116
117/* {{{ */
118static void dom_xpath_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *document_ce)
119{
120 zval *doc;
121 bool register_node_ns = true;
122 xmlDocPtr docp = NULL;
123 dom_object *docobj;
124
125 if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &doc, document_ce, &register_node_ns) != SUCCESS) {
127 }
128
129 DOM_GET_OBJ(docp, doc, xmlDocPtr, docobj);
130
131 xmlXPathContextPtr ctx = xmlXPathNewContext(docp);
132 if (ctx == NULL) {
135 }
136
138 xmlXPathContextPtr oldctx = intern->dom.ptr;
139 if (oldctx != NULL) {
140 php_libxml_decrement_doc_ref((php_libxml_node_object *) &intern->dom);
141 xmlXPathFreeContext(oldctx);
144 }
145
146 xmlXPathRegisterFuncNS (ctx, (const xmlChar *) "functionString",
147 (const xmlChar *) "http://php.net/xpath",
148 dom_xpath_ext_function_string_php);
149 xmlXPathRegisterFuncNS (ctx, (const xmlChar *) "function",
150 (const xmlChar *) "http://php.net/xpath",
151 dom_xpath_ext_function_object_php);
152
153 intern->dom.ptr = ctx;
154 ctx->userData = (void *)intern;
155 intern->dom.document = docobj->document;
156 intern->register_node_ns = register_node_ns;
157 php_libxml_increment_doc_ref((php_libxml_node_object *) &intern->dom, docp);
158}
159
160PHP_METHOD(DOMXPath, __construct)
161{
163}
164
165PHP_METHOD(Dom_XPath, __construct)
166{
168}
169/* }}} end DOMXPath::__construct */
170
171/* {{{ document DOMDocument*/
172zend_result dom_xpath_document_read(dom_object *obj, zval *retval)
173{
174 xmlDoc *docp = NULL;
175 xmlXPathContextPtr ctx = (xmlXPathContextPtr) obj->ptr;
176
177 if (ctx) {
178 docp = (xmlDocPtr) ctx->doc;
179 }
180
181 if (UNEXPECTED(!docp)) {
182 php_dom_throw_error(INVALID_STATE_ERR, /* strict */ true);
183 return FAILURE;
184 }
185
186 php_dom_create_object((xmlNodePtr) docp, retval, obj);
187 return SUCCESS;
188}
189/* }}} */
190
191/* {{{ registerNodeNamespaces bool*/
192static inline dom_xpath_object *php_xpath_obj_from_dom_obj(dom_object *obj) {
193 return (dom_xpath_object*)((char*)(obj) - XtOffsetOf(dom_xpath_object, dom));
194}
195
196zend_result dom_xpath_register_node_ns_read(dom_object *obj, zval *retval)
197{
198 ZVAL_BOOL(retval, php_xpath_obj_from_dom_obj(obj)->register_node_ns);
199
200 return SUCCESS;
201}
202
203zend_result dom_xpath_register_node_ns_write(dom_object *obj, zval *newval)
204{
205 php_xpath_obj_from_dom_obj(obj)->register_node_ns = zend_is_true(newval);
206
207 return SUCCESS;
208}
209/* }}} */
210
211/* {{{ */
212PHP_METHOD(DOMXPath, registerNamespace)
213{
214 size_t prefix_len, ns_uri_len;
215 unsigned char *prefix, *ns_uri;
216
217 if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) {
219 }
220
222
223 xmlXPathContextPtr ctxp = intern->dom.ptr;
224 if (ctxp == NULL) {
225 zend_throw_error(NULL, "Invalid XPath Context");
227 }
228
229 if (xmlXPathRegisterNs(ctxp, prefix, ns_uri) != 0) {
231 }
233}
234/* }}} */
235
236static void dom_xpath_iter(zval *baseobj, dom_object *intern) /* {{{ */
237{
238 dom_nnodemap_object *mapptr = (dom_nnodemap_object *) intern->ptr;
239
240 ZVAL_COPY_VALUE(&mapptr->baseobj_zv, baseobj);
241 mapptr->nodetype = DOM_NODESET;
242}
243/* }}} */
244
245static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type, bool modern) /* {{{ */
246{
247 zval *context = NULL;
248 xmlNodePtr nodep = NULL;
249 size_t expr_len, xpath_type;
250 dom_object *nodeobj;
251 char *expr;
252
254 bool register_node_ns = intern->register_node_ns;
255
256 if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|O!b", &expr, &expr_len, &context, modern ? dom_modern_node_class_entry : dom_node_class_entry, &register_node_ns) == FAILURE) {
258 }
259
260 xmlXPathContextPtr ctxp = intern->dom.ptr;
261 if (ctxp == NULL) {
262 zend_throw_error(NULL, "Invalid XPath Context");
264 }
265
266 xmlDocPtr docp = ctxp->doc;
267 if (docp == NULL) {
268 if (modern) {
269 zend_throw_error(NULL, "Invalid XPath Document Pointer");
271 } else {
272 php_error_docref(NULL, E_WARNING, "Invalid XPath Document Pointer");
274 }
275 }
276
277 if (context != NULL) {
278 DOM_GET_OBJ(nodep, context, xmlNodePtr, nodeobj);
279 }
280
281 if (!nodep) {
282 nodep = xmlDocGetRootElement(docp);
283 }
284
285 if (nodep && docp != nodep->doc) {
286 zend_throw_error(NULL, "Node from wrong document");
288 }
289
290 ctxp->node = nodep;
291
292 php_dom_in_scope_ns in_scope_ns;
293 if (register_node_ns && nodep != NULL) {
294 if (modern) {
296 in_scope_ns = php_dom_get_in_scope_ns(ns_mapper, nodep, false);
297 } else {
298 in_scope_ns = php_dom_get_in_scope_ns_legacy(nodep);
299 }
300 ctxp->namespaces = in_scope_ns.list;
301 ctxp->nsNr = in_scope_ns.count;
302 }
303
304 xmlXPathObjectPtr xpathobjp = xmlXPathEvalExpression(BAD_CAST expr, ctxp);
305 ctxp->node = NULL;
306
307 if (register_node_ns && nodep != NULL) {
308 php_dom_in_scope_ns_destroy(&in_scope_ns);
309 ctxp->namespaces = NULL;
310 ctxp->nsNr = 0;
311 }
312
313 if (! xpathobjp) {
314 if (modern) {
315 if (!EG(exception)) {
316 zend_throw_error(NULL, "Could not evaluate XPath expression");
317 }
319 } else {
320 /* Should have already emit a warning by libxml */
322 }
323 }
324
325 if (type == PHP_DOM_XPATH_QUERY) {
326 xpath_type = XPATH_NODESET;
327 } else {
328 xpath_type = xpathobjp->type;
329 }
330
331 switch (xpath_type) {
332
333 case XPATH_NODESET:
334 {
335 xmlNodeSetPtr nodesetp;
336 zval retval;
337
338 if (xpathobjp->type == XPATH_NODESET && NULL != (nodesetp = xpathobjp->nodesetval) && nodesetp->nodeNr) {
339 array_init_size(&retval, nodesetp->nodeNr);
341 for (int i = 0; i < nodesetp->nodeNr; i++) {
342 xmlNodePtr node = nodesetp->nodeTab[i];
343 zval child;
344
345 if (node->type == XML_NAMESPACE_DECL) {
346 if (modern) {
347 if (!EG(exception)) {
349 "The namespace axis is not well-defined in the living DOM specification. "
350 "Use Dom\\Element::getInScopeNamespaces() or Dom\\Element::getDescendantNamespaces() instead.",
351 /* strict */ true
352 );
353 }
354 break;
355 }
356
357 xmlNodePtr nsparent = node->_private;
358 xmlNsPtr original = (xmlNsPtr) node;
359
360 /* Make sure parent dom object exists, so we can take an extra reference. */
361 zval parent_zval; /* don't destroy me, my lifetime is transfered to the fake namespace decl */
362 php_dom_create_object(nsparent, &parent_zval, &intern->dom);
363 dom_object *parent_intern = Z_DOMOBJ_P(&parent_zval);
364
365 node = php_dom_create_fake_namespace_decl(nsparent, original, &child, parent_intern);
366 } else {
367 php_dom_create_object(node, &child, &intern->dom);
368 }
369 add_next_index_zval(&retval, &child);
370 }
371 } else {
373 }
375 nodeobj = Z_DOMOBJ_P(return_value);
376 dom_xpath_iter(&retval, nodeobj);
377 break;
378 }
379
380 case XPATH_BOOLEAN:
381 RETVAL_BOOL(xpathobjp->boolval);
382 break;
383
384 case XPATH_NUMBER:
385 RETVAL_DOUBLE(xpathobjp->floatval);
386 break;
387
388 case XPATH_STRING:
389 RETVAL_STRING((char *) xpathobjp->stringval);
390 break;
391
392 default:
393 RETVAL_NULL();
394 break;
395 }
396
397 xmlXPathFreeObject(xpathobjp);
398}
399/* }}} */
400
401/* {{{ */
402PHP_METHOD(DOMXPath, query)
403{
404 php_xpath_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_DOM_XPATH_QUERY, false);
405}
406
407PHP_METHOD(Dom_XPath, query)
408{
409 php_xpath_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_DOM_XPATH_QUERY, true);
410}
411/* }}} end dom_xpath_query */
412
413/* {{{ */
414PHP_METHOD(DOMXPath, evaluate)
415{
416 php_xpath_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_DOM_XPATH_EVALUATE, false);
417}
418
419PHP_METHOD(Dom_XPath, evaluate)
420{
421 php_xpath_eval(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_DOM_XPATH_EVALUATE, true);
422}
423/* }}} end dom_xpath_evaluate */
424
425/* {{{ */
426PHP_METHOD(DOMXPath, registerPhpFunctions)
427{
429
430 zend_string *callable_name = NULL;
431 HashTable *callable_ht = NULL;
432
435 Z_PARAM_ARRAY_HT_OR_STR_OR_NULL(callable_ht, callable_name)
437
439 &intern->xpath_callbacks,
440 intern->dom.ptr,
441 NULL,
442 callable_name,
443 callable_ht,
445 NULL
446 );
447}
448/* }}} end dom_xpath_register_php_functions */
449
450static void dom_xpath_register_func_in_ctx(void *ctxt, const zend_string *ns, const zend_string *name)
451{
452 xmlXPathRegisterFuncNS((xmlXPathContextPtr) ctxt, (const xmlChar *) ZSTR_VAL(name), (const xmlChar *) ZSTR_VAL(ns), dom_xpath_ext_function_trampoline);
453}
454
455PHP_METHOD(DOMXPath, registerPhpFunctionNS)
456{
458
459 zend_string *namespace, *name;
460 zend_fcall_info fci;
462
464 Z_PARAM_PATH_STR(namespace)
468
469 if (zend_string_equals_literal(namespace, "http://php.net/xpath")) {
471 zend_argument_value_error(1, "must not be \"http://php.net/xpath\" because it is reserved by PHP");
473 }
474
476 &intern->xpath_callbacks,
477 intern->dom.ptr,
478 namespace,
479 name,
480 &fcc,
482 dom_xpath_register_func_in_ctx
483 ) != SUCCESS) {
485 }
486}
487
488/* {{{ */
489PHP_METHOD(DOMXPath, quote) {
490 const char *input;
491 size_t input_len;
492 if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &input, &input_len) == FAILURE) {
494 }
495 if (memchr(input, '\'', input_len) == NULL) {
496 zend_string *const output = zend_string_safe_alloc(1, input_len, 2, false);
497 ZSTR_VAL(output)[0] = '\'';
498 memcpy(ZSTR_VAL(output) + 1, input, input_len);
499 ZSTR_VAL(output)[input_len + 1] = '\'';
500 ZSTR_VAL(output)[input_len + 2] = '\0';
501 RETURN_STR(output);
502 } else if (memchr(input, '"', input_len) == NULL) {
503 zend_string *const output = zend_string_safe_alloc(1, input_len, 2, false);
504 ZSTR_VAL(output)[0] = '"';
505 memcpy(ZSTR_VAL(output) + 1, input, input_len);
506 ZSTR_VAL(output)[input_len + 1] = '"';
507 ZSTR_VAL(output)[input_len + 2] = '\0';
508 RETURN_STR(output);
509 } else {
510 smart_str output = {0};
511 // need to use the concat() trick published by Robert Rossney at https://stackoverflow.com/a/1352556/1067003
512 smart_str_appendl(&output, ZEND_STRL("concat("));
513 const char *ptr = input;
514 const char *const end = input + input_len;
515 while (ptr < end) {
516 const char *const single_quote_ptr = memchr(ptr, '\'', end - ptr);
517 const char *const double_quote_ptr = memchr(ptr, '"', end - ptr);
518 const size_t distance_to_single_quote = single_quote_ptr ? single_quote_ptr - ptr : end - ptr;
519 const size_t distance_to_double_quote = double_quote_ptr ? double_quote_ptr - ptr : end - ptr;
520 const size_t bytes_until_quote = MAX(distance_to_single_quote, distance_to_double_quote);
521 const char quote_method = (distance_to_single_quote > distance_to_double_quote) ? '\'' : '"';
522 smart_str_appendc(&output, quote_method);
523 smart_str_appendl(&output, ptr, bytes_until_quote);
524 smart_str_appendc(&output, quote_method);
525 ptr += bytes_until_quote;
526 smart_str_appendc(&output, ',');
527 }
528 ZEND_ASSERT(ptr == end);
529 ZSTR_VAL(output.s)[output.s->len - 1] = ')';
530 RETURN_STR(smart_str_extract(&output));
531 }
532}
533/* }}} */
534
535#endif /* LIBXML_XPATH_ENABLED */
536
537#endif
bool exception
Definition assert.c:30
PHP_DOM_EXPORT zend_class_entry * dom_modern_node_class_entry
PHP_DOM_EXPORT zend_class_entry * dom_node_class_entry
PHP_DOM_EXPORT zend_class_entry * dom_abstract_base_document_class_entry
PHP_DOM_EXPORT zend_class_entry * dom_document_class_entry
void php_dom_throw_error_with_message(dom_exception_code error_code, const char *error_message, bool strict_error)
void php_dom_throw_error(dom_exception_code error_code, bool strict_error)
@ INVALID_STATE_ERR
@ NOT_SUPPORTED_ERR
zend_ffi_type * type
Definition ffi.c:3812
zend_long n
Definition ffi.c:4979
void * ptr
Definition ffi.c:3814
memcpy(ptr1, ptr2, size)
#define NULL
Definition gdcache.h:45
#define prefix
#define SUCCESS
Definition hash_sha3.c:261
foreach($dp as $el) foreach( $dp as $el) if( $pass2< 2) echo ""
PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format,...)
Definition main.c:1173
PHP_DOM_EXPORT php_dom_in_scope_ns php_dom_get_in_scope_ns_legacy(const xmlNode *node)
PHP_DOM_EXPORT php_dom_in_scope_ns php_dom_get_in_scope_ns(php_dom_libxml_ns_mapper *ns_mapper, const xmlNode *node, bool ignore_elements)
PHP_DOM_EXPORT void php_dom_in_scope_ns_destroy(php_dom_in_scope_ns *in_scope_ns)
PHP_DOM_EXPORT php_dom_libxml_ns_mapper * php_dom_get_ns_mapper(dom_object *object)
#define PHP_METHOD
Definition php.h:365
#define DOM_NODESET
Definition php_dom.h:65
#define Z_XPATHOBJ_P(zv)
Definition php_dom.h:78
xmlNodePtr php_dom_create_fake_namespace_decl(xmlNodePtr nodep, xmlNsPtr original, zval *return_value, dom_object *parent_intern)
#define DOM_GET_OBJ(__ptr, __id, __prtype, __intern)
Definition php_dom.h:237
void php_dom_create_iterator(zval *return_value, dom_iterator_type iterator_type, bool modern)
@ DOM_NODELIST
Definition php_dom.h:115
unsigned const char * end
Definition php_ffi.h:51
void * ptr
Definition xml_common.h:26
zend_object std
Definition xml_common.h:29
php_libxml_ref_obj * document
Definition xml_common.h:27
Definition dce.c:49
bool register_node_ns
Definition php_dom.h:69
dom_object dom
Definition php_dom.h:70
php_dom_xpath_callbacks xpath_callbacks
Definition php_dom.h:68
struct _dom_object dom_object
#define Z_DOMOBJ_P(zv)
Definition xml_common.h:36
PHP_DOM_EXPORT bool php_dom_create_object(xmlNodePtr obj, zval *return_value, dom_object *domobj)
PHP_DOM_EXPORT void php_dom_xpath_callbacks_clean_argument_stack(xmlXPathParserContextPtr ctxt, uint32_t num_args)
PHP_DOM_EXPORT zend_result php_dom_xpath_callbacks_update_method_handler(php_dom_xpath_callbacks *registry, xmlXPathContextPtr ctxt, zend_string *ns, zend_string *name, const HashTable *callable_ht, php_dom_xpath_callback_name_validation name_validation, php_dom_xpath_callbacks_register_func_ctx register_func)
PHP_DOM_EXPORT zend_result php_dom_xpath_callbacks_call_custom_ns(php_dom_xpath_callbacks *xpath_callbacks, xmlXPathParserContextPtr ctxt, int num_args, php_dom_xpath_nodeset_evaluation_mode evaluation_mode, dom_object *intern, php_dom_xpath_callbacks_proxy_factory proxy_factory)
PHP_DOM_EXPORT void php_dom_xpath_callbacks_dtor(php_dom_xpath_callbacks *registry)
PHP_DOM_EXPORT zend_result php_dom_xpath_callbacks_call_php_ns(php_dom_xpath_callbacks *xpath_callbacks, xmlXPathParserContextPtr ctxt, int num_args, php_dom_xpath_nodeset_evaluation_mode evaluation_mode, dom_object *intern, php_dom_xpath_callbacks_proxy_factory proxy_factory)
PHP_DOM_EXPORT void php_dom_xpath_callbacks_ctor(php_dom_xpath_callbacks *registry)
@ PHP_DOM_XPATH_CALLBACK_NAME_VALIDATE_NCNAME
@ PHP_DOM_XPATH_CALLBACK_NAME_VALIDATE_NULLS
php_dom_xpath_nodeset_evaluation_mode
@ PHP_DOM_XPATH_EVALUATE_NODESET_TO_STRING
@ PHP_DOM_XPATH_EVALUATE_NODESET_TO_NODESET
PHP_DOM_EXPORT HashTable * php_dom_xpath_callbacks_get_gc_for_whole_object(php_dom_xpath_callbacks *registry, zend_object *object, zval **table, int *n)
PHP_DOM_EXPORT zend_result php_dom_xpath_callbacks_update_single_method_handler(php_dom_xpath_callbacks *registry, xmlXPathContextPtr ctxt, zend_string *ns, zend_string *name, const zend_fcall_info_cache *fcc, php_dom_xpath_callback_name_validation name_validation, php_dom_xpath_callbacks_register_func_ctx register_func)
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format,...)
Definition zend.c:1772
#define INTERNAL_FUNCTION_PARAMETERS
Definition zend.h:49
#define INTERNAL_FUNCTION_PARAM_PASSTHRU
Definition zend.h:50
ZEND_API zend_result zend_parse_parameters(uint32_t num_args, const char *type_spec,...)
Definition zend_API.c:1300
ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *format,...)
Definition zend_API.c:433
ZEND_API void zend_release_fcall_info_cache(zend_fcall_info_cache *fcc)
Definition zend_API.c:3845
#define Z_PARAM_PATH_STR(dest)
Definition zend_API.h:2041
#define ZEND_NUM_ARGS()
Definition zend_API.h:530
struct _zend_fcall_info_cache zend_fcall_info_cache
#define Z_PARAM_ARRAY_HT_OR_STR_OR_NULL(dest_ht, dest_str)
Definition zend_API.h:2154
#define ZEND_PARSE_PARAMETERS_END()
Definition zend_API.h:1641
#define RETURN_FALSE
Definition zend_API.h:1058
#define RETVAL_STRING(s)
Definition zend_API.h:1017
#define RETVAL_DOUBLE(d)
Definition zend_API.h:1012
#define array_init_size(arg, size)
Definition zend_API.h:538
#define Z_PARAM_OPTIONAL
Definition zend_API.h:1667
#define ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args)
Definition zend_API.h:1620
#define RETVAL_NULL()
Definition zend_API.h:1010
struct _zend_fcall_info zend_fcall_info
#define RETURN_THROWS()
Definition zend_API.h:1060
#define RETURN_STR(s)
Definition zend_API.h:1039
#define ZEND_THIS
Definition zend_API.h:523
#define RETVAL_BOOL(b)
Definition zend_API.h:1009
#define Z_PARAM_FUNC_NO_TRAMPOLINE_FREE(dest_fci, dest_fcc)
Definition zend_API.h:1827
#define RETURN_TRUE
Definition zend_API.h:1059
struct _zval_struct zval
#define E_WARNING
Definition zend_errors.h:24
ZEND_API bool zend_is_executing(void)
#define EG(v)
ZEND_API void ZEND_FASTCALL zend_hash_real_init_packed(HashTable *ht)
Definition zend_hash.c:330
#define ZVAL_EMPTY_ARRAY(z)
Definition zend_hash.h:87
struct _zend_string zend_string
ZEND_API void zend_object_std_dtor(zend_object *object)
ZEND_API bool ZEND_FASTCALL zend_is_true(const zval *op)
#define ZEND_IGNORE_VALUE(x)
#define XtOffsetOf(s_type, field)
#define ZEND_ASSERT(c)
#define ZEND_STRL(str)
#define UNEXPECTED(condition)
#define MAX(a, b)
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object
#define ZSTR_VAL(zstr)
Definition zend_string.h:68
#define zend_string_equals_literal(str, literal)
#define Z_ARRVAL_P(zval_p)
Definition zend_types.h:987
struct _zend_array HashTable
Definition zend_types.h:386
@ FAILURE
Definition zend_types.h:61
ZEND_RESULT_CODE zend_result
Definition zend_types.h:64
#define ZVAL_COPY_VALUE(z, v)
#define ZVAL_BOOL(z, b)
zval retval
zval * return_value
zend_string * name