php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
callback_filter.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: Derick Rethans <derick@php.net> |
14 +----------------------------------------------------------------------+
15*/
16
17#include "php_filter.h"
18
20{
22 zval args[1];
23 int status;
24
25 if (!option_array || !zend_is_callable(option_array, IS_CALLABLE_SUPPRESS_DEPRECATIONS, NULL)) {
26 zend_type_error("%s(): Option must be a valid callback", get_active_function_name());
29 return;
30 }
31
32 ZVAL_COPY(&args[0], value);
33 status = call_user_function(NULL, NULL, option_array, &retval, 1, args);
34
35 if (status == SUCCESS && !Z_ISUNDEF(retval)) {
38 } else {
41 }
42
44}
void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
DNS_STATUS status
Definition dns_win32.c:49
#define NULL
Definition gdcache.h:45
#define SUCCESS
Definition hash_sha3.c:261
#define PHP_INPUT_FILTER_PARAM_DECL
Definition php_filter.h:58
ZEND_API ZEND_COLD void zend_type_error(const char *format,...)
Definition zend.c:1824
ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name)
Definition zend_API.c:4286
#define IS_CALLABLE_SUPPRESS_DEPRECATIONS
Definition zend_API.h:412
#define call_user_function(function_table, object, function_name, retval_ptr, param_count, params)
Definition zend_API.h:687
struct _zval_struct zval
zval * args
ZEND_API const char * get_active_function_name(void)
#define ZVAL_NULL(z)
#define Z_ISUNDEF(zval)
Definition zend_types.h:956
#define ZVAL_COPY(z, v)
#define ZVAL_COPY_VALUE(z, v)
ZEND_API void zval_ptr_dtor(zval *zval_ptr)
zval retval
value