interface DOMParentNode
{
- /** @var ...DOMNode|string $nodes */
+ /** @param DOMNode|string $nodes */
public function append(...$nodes): void;
- /** @var ...DOMNode|string $nodes */
+ /** @param DOMNode|string $nodes */
public function prepend(...$nodes): void;
}
{
public function remove(): void;
- /** @var ...DOMNode|string $nodes */
+ /** @param DOMNode|string $nodes */
public function before(... $nodes): void;
- /** @var ...DOMNode|string $nodes */
+ /** @param DOMNode|string $nodes */
public function after(...$nodes): void;
- /** @var ...DOMNode|string $nodes */
+ /** @param DOMNode|string $nodes */
public function replaceWith(...$nodes): void;
}
/** @return bool */
public function appendXML(string $data) {}
- /** @var ...DOMNode|string $nodes */
+ /** @param DOMNode|string $nodes */
public function append(...$nodes): void {}
- /** @var ...DOMNode|string $nodes */
+ /** @param DOMNode|string $nodes */
public function prepend(...$nodes): void {}
}
/** @return bool */
public function replaceData(int $offset, int $count, string $data) {}
- /** @var ...DOMNode|string $nodes */
+ /** @param DOMNode|string $nodes */
public function replaceWith(...$nodes): void {}
public function remove(): void {}
- /** @var ...DOMNode|string $nodes */
+ /** @param DOMNode|string $nodes */
public function before(... $nodes): void {}
- /** @var ...DOMNode|string $nodes */
+ /** @param DOMNode|string $nodes */
public function after(...$nodes): void {}
}
public function remove(): void {}
- /** @var ...DOMNode|string $nodes */
+ /** @param DOMNode|string $nodes */
public function before(... $nodes): void {}
- /** @var ...DOMNode|string $nodes */
+ /** @param DOMNode|string $nodes */
public function after(...$nodes): void {}
- /** @var ...DOMNode|string $nodes */
+ /** @param DOMNode|string $nodes */
public function replaceWith(...$nodes): void {}
- /** @var ...DOMNode|string $nodes */
+ /** @param DOMNode|string $nodes */
public function append(...$nodes): void {}
- /** @var ...DOMNode|string $nodes */
+ /** @param DOMNode|string $nodes */
public function prepend(...$nodes): void {}
}
/** @return DOMNode|false */
public function adoptNode(DOMNode $node) {}
- /** @var ...DOMNode|string $nodes */
+ /** @param DOMNode|string $nodes */
public function append(...$nodes): void {}
- /** @var ...DOMNode|string $nodes */
+ /** @param DOMNode|string $nodes */
public function prepend(...$nodes): void {}
}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 3ecc7d640235675f1f573f043e68f11a4fca0bad */
+ * Stub hash: 6d25769eb3f8686042dccc55d8d8bd5e3852676f */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_dom_import_simplexml, 0, 1, DOMElement, 1)
ZEND_ARG_TYPE_INFO(0, node, IS_OBJECT, 0)
ZEND_METHOD(FFI, cast) /* {{{ */
{
zend_string *type_def = NULL;
- zval *ztype = NULL;
+ zend_object *ztype = NULL;
zend_ffi_type *old_type, *type, *type_ptr;
zend_ffi_cdata *old_cdata, *cdata;
zend_bool is_const = 0;
ZEND_FFI_VALIDATE_API_RESTRICTION();
ZEND_PARSE_PARAMETERS_START(2, 2)
- if (Z_TYPE_P(EX_VAR_NUM(0)) == IS_STRING) {
- Z_PARAM_STR(type_def)
- } else {
- Z_PARAM_OBJECT_OF_CLASS(ztype, zend_ffi_ctype_ce)
- }
- Z_PARAM_ZVAL(zv);
+ Z_PARAM_STR_OR_OBJ_OF_CLASS(type_def, ztype, zend_ffi_ctype_ce)
+ Z_PARAM_ZVAL(zv)
ZEND_PARSE_PARAMETERS_END();
arg = zv;
type_ptr = dcl.type;
} else {
- zend_ffi_ctype *ctype = (zend_ffi_ctype*)Z_OBJ_P(ztype);
+ zend_ffi_ctype *ctype = (zend_ffi_ctype*) ztype;
type_ptr = type = ctype->type;
if (ZEND_FFI_TYPE_IS_OWNED(type)) {
public static function free(FFI\CData $ptr): void {}
/**
- * @param FFI\CType|string $type
+ * @param FFI\CData|string|int|null $ptr
* @prefer-ref $ptr
*/
- public static function cast($type, $ptr): ?FFI\CData {}
+ public static function cast(FFI\CType|string $type, $ptr): ?FFI\CData {}
public static function type(string $type): ?FFI\CType {}
public static function alignof(object $ptr): ?int {}
/**
+ * @param FFI\CData|string $src
* @prefer-ref $dst
* @prefer-ref $src
- * @param string|FFI\CData $dst
*/
public static function memcpy(FFI\CData $dst, $src, int $size): void {}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: e66d306e0dbe08ec3d66935c69ab9e36b9b8165a */
+ * Stub hash: a486305cd865e2798f7d9916760a3ec3c6f114b0 */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_cdef, 0, 0, FFI, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, code, IS_STRING, 0, "\"\"")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_cast, 0, 2, FFI\\CData, 1)
- ZEND_ARG_INFO(0, type)
+ ZEND_ARG_OBJ_TYPE_MASK(0, type, FFI\\CType, MAY_BE_STRING, NULL)
ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, ptr)
ZEND_END_ARG_INFO()
function imagettftext(GdImage $im, float $size, float $angle, int $x, int $y, int $col, string $font_file, string $text): array|false {}
#endif
-function imagefilter(GdImage $im, int $filtertype, $arg1 = UNKNOWN, $arg2 = UNKNOWN, $arg3 = UNKNOWN, $arg4 = UNKNOWN): bool {}
+/** @param array|int|float|bool $filter_args */
+function imagefilter(GdImage $im, int $filtertype, ...$filter_args): bool {}
function imageconvolution(GdImage $im, array $matrix3x3, float $div, float $offset): bool {}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: a792b0c5497013c85cca83c4baab928a5191f3b9 */
+ * Stub hash: 540beb37f18b81102e7977447399757e865285c2 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gd_info, 0, 0, IS_ARRAY, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imagefilter, 0, 2, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, im, GdImage, 0)
ZEND_ARG_TYPE_INFO(0, filtertype, IS_LONG, 0)
- ZEND_ARG_INFO(0, arg1)
- ZEND_ARG_INFO(0, arg2)
- ZEND_ARG_INFO(0, arg3)
- ZEND_ARG_INFO(0, arg4)
+ ZEND_ARG_VARIADIC_INFO(0, filter_args)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imageconvolution, 0, 4, _IS_BOOL, 0)
/** @generate-function-entries */
+/** @param array $subpatterns */
function preg_match(string $pattern, string $subject, &$subpatterns = null, int $flags = 0, int $offset = 0): int|false {}
+/** @param array $subpatterns */
function preg_match_all(string $pattern, string $subject, &$subpatterns = null, int $flags = 0, int $offset = 0): int|false|null {}
+/** @param int $count */
function preg_replace(string|array $regex, string|array $replace, string|array $subject, int $limit = -1, &$count = null): string|array|null {}
+/** @param int $count */
function preg_filter(string|array $regex, string|array $replace, string|array $subject, int $limit = -1, &$count = null): string|array|null {}
+/** @param int $count */
function preg_replace_callback(string|array $regex, callable $callback, string|array $subject, int $limit = -1, &$count = null, int $flags = 0): string|array|null {}
-/** @param string|array $subject */
+/**
+ * @param array|string $subject
+ * @param int $count
+ */
function preg_replace_callback_array(array $pattern, $subject, int $limit = -1, &$count = null, int $flags = 0): string|array|null {}
function preg_split(string $pattern, string $subject, int $limit = -1, int $flags = 0): array|false {}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 88e664fe3f4714ab7760a99bffef5c11eafcf0aa */
+ * Stub hash: 8e8fea5b33408e8a1a39c1b1ae71f16fe1bdd391 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_preg_match, 0, 2, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
}
/* }}} */
-static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, int is_param) /* {{{ */
+static void register_bound_param(INTERNAL_FUNCTION_PARAMETERS, int is_param) /* {{{ */
{
struct pdo_bound_param_data param;
zend_long param_type = PDO_PARAM_STR;
zval *parameter, *driver_params = NULL;
memset(¶m, 0, sizeof(param));
- param.paramno = -1;
-
- if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
- "lz|llz!", ¶m.paramno, ¶meter, ¶m_type, ¶m.max_value_len,
- &driver_params)) {
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|llz!", ¶m.name,
- ¶meter, ¶m_type, ¶m.max_value_len,
- &driver_params)) {
- return 0;
- }
- }
+
+ ZEND_PARSE_PARAMETERS_START(2, 5)
+ Z_PARAM_STR_OR_LONG(param.name, param.paramno)
+ Z_PARAM_ZVAL(parameter)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(param_type)
+ Z_PARAM_LONG(param.max_value_len)
+ Z_PARAM_ZVAL_OR_NULL(driver_params)
+ ZEND_PARSE_PARAMETERS_END();
+
+ PHP_STMT_GET_OBJ;
param.param_type = (int) param_type;
- if (param.paramno > 0) {
+ if (param.name) {
+ param.paramno = -1;
+ } else if (param.paramno > 0) {
--param.paramno; /* make it zero-based internally */
- } else if (!param.name) {
+ } else {
pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "Columns/Parameters are 1-based");
- return 0;
+ RETURN_FALSE;
}
if (driver_params) {
if (!Z_ISUNDEF(param.parameter)) {
zval_ptr_dtor(&(param.parameter));
}
- return 0;
+
+ RETURN_FALSE;
}
- return 1;
+
+ RETURN_TRUE;
} /* }}} */
/* {{{ bind an input parameter to the value of a PHP variable. $paramno is the 1-based position of the placeholder in the SQL statement (but can be the parameter name for drivers that support named placeholders). It should be called prior to execute(). */
zval *parameter;
memset(¶m, 0, sizeof(param));
- param.paramno = -1;
- if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
- "lz|l", ¶m.paramno, ¶meter, ¶m_type)) {
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", ¶m.name,
- ¶meter, ¶m_type)) {
- return;
- }
- }
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR_OR_LONG(param.name, param.paramno)
+ Z_PARAM_ZVAL(parameter)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(param_type)
+ ZEND_PARSE_PARAMETERS_END();
PHP_STMT_GET_OBJ;
param.param_type = (int) param_type;
- if (param.paramno > 0) {
+ if (param.name) {
+ param.paramno = -1;
+ } else if (param.paramno > 0) {
--param.paramno; /* make it zero-based internally */
- } else if (!param.name) {
+ } else {
pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "Columns/Parameters are 1-based");
RETURN_FALSE;
}
/* {{{ bind a parameter to a PHP variable. $paramno is the 1-based position of the placeholder in the SQL statement (but can be the parameter name for drivers that support named placeholders). This isn't supported by all drivers. It should be called prior to execute(). */
PHP_METHOD(PDOStatement, bindParam)
{
- PHP_STMT_GET_OBJ;
- RETURN_BOOL(register_bound_param(INTERNAL_FUNCTION_PARAM_PASSTHRU, stmt, TRUE));
+ register_bound_param(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
/* }}} */
/* {{{ bind a column to a PHP variable. On each row fetch $param will contain the value of the corresponding column. $column is the 1-based offset of the column, or the column name. For portability, don't call this before execute(). */
PHP_METHOD(PDOStatement, bindColumn)
{
- PHP_STMT_GET_OBJ;
- RETURN_BOOL(register_bound_param(INTERNAL_FUNCTION_PARAM_PASSTHRU, stmt, 0));
+ register_bound_param(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
class PDOStatement implements IteratorAggregate
{
/** @return bool */
- public function bindColumn(int|string $column, &$param, int $type = 0, int $maxlen = 0, mixed $driverdata = null) {}
+ public function bindColumn(string|int $column, mixed &$param, int $type = 0, int $maxlen = 0, mixed $driverdata = null) {}
/** @return bool */
- public function bindParam(int|string $parameter, &$param, int $type = PDO::PARAM_STR, int $maxlen = 0, mixed $driverdata = null) {}
+ public function bindParam(string|int $parameter, mixed &$param, int $type = PDO::PARAM_STR, int $maxlen = 0, mixed $driverdata = null) {}
- /**
- * @param int|string $parameter
- * @param mixed $value
- * @return bool
- */
- public function bindValue($parameter, $value, int $type = PDO::PARAM_STR) {}
+ /** @return bool */
+ public function bindValue(string|int $parameter, mixed $value, int $type = PDO::PARAM_STR) {}
/** @return bool */
public function closeCursor() {}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 1802a0ceaa7be9a7644d1b943d2b7d70be23ec75 */
+ * Stub hash: d64c75660cfc44b582e7dcc20c4ce22e8e0848e1 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindColumn, 0, 0, 2)
- ZEND_ARG_TYPE_MASK(0, column, MAY_BE_LONG|MAY_BE_STRING, NULL)
- ZEND_ARG_INFO(1, param)
+ ZEND_ARG_TYPE_MASK(0, column, MAY_BE_STRING|MAY_BE_LONG, NULL)
+ ZEND_ARG_TYPE_INFO(1, param, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, maxlen, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, driverdata, IS_MIXED, 0, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindParam, 0, 0, 2)
- ZEND_ARG_TYPE_MASK(0, parameter, MAY_BE_LONG|MAY_BE_STRING, NULL)
- ZEND_ARG_INFO(1, param)
+ ZEND_ARG_TYPE_MASK(0, parameter, MAY_BE_STRING|MAY_BE_LONG, NULL)
+ ZEND_ARG_TYPE_INFO(1, param, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "PDO::PARAM_STR")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, maxlen, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, driverdata, IS_MIXED, 0, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PDOStatement_bindValue, 0, 0, 2)
- ZEND_ARG_INFO(0, parameter)
- ZEND_ARG_INFO(0, value)
+ ZEND_ARG_TYPE_MASK(0, parameter, MAY_BE_STRING|MAY_BE_LONG, NULL)
+ ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "PDO::PARAM_STR")
ZEND_END_ARG_INFO()
--FILE--
<?php
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+/** @var PDO $db */
$db = MySQLPDOTest::factory();
$db->query('DROP TABLE IF EXISTS test');
select * from test where id = ?;
update test set id = 2 where id = ?;');
-$handle1->bindValue('1', '1');
-$handle1->bindValue('2', '1');
+$handle1->bindValue(1, '1');
+$handle1->bindValue(2, '1');
$handle1->execute();
$i = 1;
$handle2 = $db->prepare('select * from test where id = ?;
update test set id = 1 where id = ?;');
-$handle2->bindValue('1', '2');
-$handle2->bindValue('2', '2');
+$handle2->bindValue(1, '2');
+$handle2->bindValue(2, '2');
$handle2->execute();
$handle3 = $db->prepare('update test set id = 2 where id = ?;
select * from test where id = ?;');
-$handle3->bindValue('1', '1');
-$handle3->bindValue('2', '2');
+$handle3->bindValue(1, '1');
+$handle3->bindValue(2, '2');
$handle3->execute();
update test set id = 2 where id = ?;
select * from test where id = ?;');
-$handle4->bindValue('1', '3');
-$handle4->bindValue('2', '2');
+$handle4->bindValue(1, '3');
+$handle4->bindValue(2, '2');
$handle4->execute();
/* {{{ SoapHeader constructor */
PHP_METHOD(SoapHeader, __construct)
{
- zval *data = NULL, *actor = NULL;
+ zval *data = NULL;
+ zend_string *actor_str = NULL;
+ zend_long actor_long;
+ zend_bool actor_is_null = 1;
char *name, *ns;
size_t name_len, ns_len;
zend_bool must_understand = 0;
zval *this_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|zbz", &ns, &ns_len, &name, &name_len, &data, &must_understand, &actor) == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_START(2, 5)
+ Z_PARAM_STRING(ns, ns_len)
+ Z_PARAM_STRING(name, name_len)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL(data)
+ Z_PARAM_BOOL(must_understand)
+ Z_PARAM_STR_OR_LONG_OR_NULL(actor_str, actor_long, actor_is_null)
+ ZEND_PARSE_PARAMETERS_END();
+
if (ns_len == 0) {
php_error_docref(NULL, E_WARNING, "Invalid namespace");
return;
add_property_zval(this_ptr, "data", data);
}
add_property_bool(this_ptr, "mustUnderstand", must_understand);
- if (actor == NULL) {
- } else if (Z_TYPE_P(actor) == IS_LONG &&
- (Z_LVAL_P(actor) == SOAP_ACTOR_NEXT ||
- Z_LVAL_P(actor) == SOAP_ACTOR_NONE ||
- Z_LVAL_P(actor) == SOAP_ACTOR_UNLIMATERECEIVER)) {
- add_property_long(this_ptr, "actor", Z_LVAL_P(actor));
- } else if (Z_TYPE_P(actor) == IS_STRING && Z_STRLEN_P(actor) > 0) {
- add_property_stringl(this_ptr, "actor", Z_STRVAL_P(actor), Z_STRLEN_P(actor));
- } else {
- php_error_docref(NULL, E_WARNING, "Invalid actor");
+
+ if (actor_str) {
+ if (ZSTR_LEN(actor_str) > 2) {
+ add_property_stringl(this_ptr, "actor", ZSTR_VAL(actor_str), ZSTR_LEN(actor_str));
+ } else {
+ php_error_docref(NULL, E_WARNING, "Invalid actor");
+ }
+ } else if (!actor_is_null) {
+ if ((actor_long == SOAP_ACTOR_NEXT || actor_long == SOAP_ACTOR_NONE || actor_long == SOAP_ACTOR_UNLIMATERECEIVER)) {
+ add_property_long(this_ptr, "actor", actor_long);
+ } else {
+ php_error_docref(NULL, E_WARNING, "Invalid actor");
+ }
}
}
/* }}} */
{
char *fault_string = NULL, *fault_code = NULL, *fault_actor = NULL, *name = NULL, *fault_code_ns = NULL;
size_t fault_string_len, fault_actor_len = 0, name_len = 0, fault_code_len = 0;
- zval *code = NULL, *details = NULL, *headerfault = NULL, *this_ptr;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs|s!z!s!z!",
- &code,
- &fault_string, &fault_string_len,
- &fault_actor, &fault_actor_len,
- &details, &name, &name_len, &headerfault) == FAILURE) {
- RETURN_THROWS();
- }
-
- if (Z_TYPE_P(code) == IS_NULL) {
- } else if (Z_TYPE_P(code) == IS_STRING) {
- fault_code = Z_STRVAL_P(code);
- fault_code_len = Z_STRLEN_P(code);
- } else if (Z_TYPE_P(code) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL_P(code)) == 2) {
- zval *t_ns = zend_hash_index_find(Z_ARRVAL_P(code), 0);
- zval *t_code = zend_hash_index_find(Z_ARRVAL_P(code), 1);
+ zval *details = NULL, *headerfault = NULL, *this_ptr;
+ zend_string *code_str;
+ HashTable *code_ht;
+
+ ZEND_PARSE_PARAMETERS_START(2, 6)
+ Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(code_str, code_ht)
+ Z_PARAM_STRING(fault_string, fault_string_len)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STRING_OR_NULL(fault_actor, fault_actor_len)
+ Z_PARAM_ZVAL_OR_NULL(details)
+ Z_PARAM_STRING_OR_NULL(name, name_len)
+ Z_PARAM_ZVAL_OR_NULL(headerfault)
+ ZEND_PARSE_PARAMETERS_END();
+
+ if (code_str) {
+ fault_code = ZSTR_VAL(code_str);
+ fault_code_len = ZSTR_LEN(code_str);
+ } else if (code_ht && zend_hash_num_elements(code_ht) == 2) {
+ zval *t_ns = zend_hash_index_find(code_ht, 0);
+ zval *t_code = zend_hash_index_find(code_ht, 1);
if (t_ns && t_code && Z_TYPE_P(t_ns) == IS_STRING && Z_TYPE_P(t_code) == IS_STRING) {
fault_code_ns = Z_STRVAL_P(t_ns);
fault_code = Z_STRVAL_P(t_code);
fault_code_len = Z_STRLEN_P(t_code);
- } else {
- php_error_docref(NULL, E_WARNING, "Invalid fault code");
- return;
}
- } else {
- php_error_docref(NULL, E_WARNING, "Invalid fault code");
- return;
}
- if (fault_code != NULL && fault_code_len == 0) {
+
+ if ((code_str || code_ht) && (fault_code == NULL || fault_code_len == 0)) {
php_error_docref(NULL, E_WARNING, "Invalid fault code");
return;
}
/* {{{ SoapVar constructor */
PHP_METHOD(SoapVar, __construct)
{
- zval *data, *type, *this_ptr;
+ zval *data, *this_ptr;
+ zend_long type;
+ zend_bool type_is_null = 1;
char *stype = NULL, *ns = NULL, *name = NULL, *namens = NULL;
size_t stype_len = 0, ns_len = 0, name_len = 0, namens_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "z!z|ssss", &data, &type, &stype, &stype_len, &ns, &ns_len, &name, &name_len, &namens, &namens_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z!l!|ssss", &data, &type, &type_is_null, &stype, &stype_len, &ns, &ns_len, &name, &name_len, &namens, &namens_len) == FAILURE) {
RETURN_THROWS();
}
this_ptr = ZEND_THIS;
- if (Z_TYPE_P(type) == IS_NULL) {
+ if (type_is_null) {
add_property_long(this_ptr, "enc_type", UNKNOWN_TYPE);
} else {
- if (zend_hash_index_exists(&SOAP_GLOBAL(defEncIndex), Z_LVAL_P(type))) {
- add_property_long(this_ptr, "enc_type", Z_LVAL_P(type));
+ if (zend_hash_index_exists(&SOAP_GLOBAL(defEncIndex), type)) {
+ add_property_long(this_ptr, "enc_type", type);
} else {
php_error_docref(NULL, E_WARNING, "Invalid type ID");
return;
PHP_METHOD(SoapServer, __construct)
{
soapServicePtr service;
- zval *wsdl = NULL, *options = NULL;
+ zval *options = NULL;
+ zend_string *wsdl;
zend_resource *res;
int version = SOAP_1_1;
zend_long cache_wsdl;
HashTable *typemap_ht = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|a", &wsdl, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S!|a", &wsdl, &options) == FAILURE) {
RETURN_THROWS();
}
SOAP_SERVER_BEGIN_CODE();
- if (Z_TYPE_P(wsdl) != IS_STRING && Z_TYPE_P(wsdl) != IS_NULL) {
- php_error_docref(NULL, E_ERROR, "Invalid parameters");
- }
-
service = emalloc(sizeof(soapService));
memset(service, 0, sizeof(soapService));
service->send_errors = 1;
if ((tmp = zend_hash_str_find(ht, "uri", sizeof("uri")-1)) != NULL &&
Z_TYPE_P(tmp) == IS_STRING) {
service->uri = estrndup(Z_STRVAL_P(tmp), Z_STRLEN_P(tmp));
- } else if (Z_TYPE_P(wsdl) == IS_NULL) {
+ } else if (!wsdl) {
php_error_docref(NULL, E_ERROR, "'uri' option is required in nonWSDL mode");
}
}
}
- } else if (Z_TYPE_P(wsdl) == IS_NULL) {
+ } else if (!wsdl) {
php_error_docref(NULL, E_ERROR, "'uri' option is required in nonWSDL mode");
}
service->soap_functions.functions_all = FALSE;
service->soap_functions.ft = zend_new_array(0);
- if (Z_TYPE_P(wsdl) != IS_NULL) {
- service->sdl = get_sdl(ZEND_THIS, Z_STRVAL_P(wsdl), cache_wsdl);
+ if (wsdl) {
+ service->sdl = get_sdl(ZEND_THIS, ZSTR_VAL(wsdl), cache_wsdl);
if (service->uri == NULL) {
if (service->sdl->target_ns) {
service->uri = estrdup(service->sdl->target_ns);
PHP_METHOD(SoapClient, __construct)
{
- zval *wsdl, *options = NULL;
+ zval *options = NULL;
+ zend_string *wsdl;
int soap_version = SOAP_1_1;
php_stream_context *context = NULL;
zend_long cache_wsdl;
HashTable *typemap_ht = NULL;
zval *this_ptr = ZEND_THIS;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|a", &wsdl, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S!|a", &wsdl, &options) == FAILURE) {
RETURN_THROWS();
}
SOAP_CLIENT_BEGIN_CODE();
- if (Z_TYPE_P(wsdl) != IS_STRING && Z_TYPE_P(wsdl) != IS_NULL) {
- php_error_docref(NULL, E_ERROR, "$wsdl must be string or null");
- }
-
cache_wsdl = SOAP_GLOBAL(cache_enabled) ? SOAP_GLOBAL(cache_mode) : 0;
if (options != NULL) {
HashTable *ht = Z_ARRVAL_P(options);
zval *tmp, tmp2;
- if (Z_TYPE_P(wsdl) == IS_NULL) {
+ if (!wsdl) {
/* Fetching non-WSDL mode options */
if ((tmp = zend_hash_str_find(ht, "uri", sizeof("uri")-1)) != NULL &&
Z_TYPE_P(tmp) == IS_STRING) {
if ((tmp = zend_hash_str_find(ht, "location", sizeof("location")-1)) != NULL &&
Z_TYPE_P(tmp) == IS_STRING) {
add_property_str(this_ptr, "location", zend_string_copy(Z_STR_P(tmp)));
- } else if (Z_TYPE_P(wsdl) == IS_NULL) {
+ } else if (!wsdl) {
php_error_docref(NULL, E_ERROR, "'location' option is required in nonWSDL mode");
}
Z_TYPE_P(tmp) == IS_LONG) {
add_property_long(this_ptr, "_ssl_method", Z_LVAL_P(tmp));
}
- } else if (Z_TYPE_P(wsdl) == IS_NULL) {
+ } else if (!wsdl) {
php_error_docref(NULL, E_ERROR, "'location' and 'uri' options are required in nonWSDL mode");
}
add_property_long(this_ptr, "_soap_version", soap_version);
- if (Z_TYPE_P(wsdl) != IS_NULL) {
+ if (wsdl) {
int old_soap_version;
zend_resource *res;
old_soap_version = SOAP_GLOBAL(soap_version);
SOAP_GLOBAL(soap_version) = soap_version;
- sdl = get_sdl(this_ptr, Z_STRVAL_P(wsdl), cache_wsdl);
+ sdl = get_sdl(this_ptr, ZSTR_VAL(wsdl), cache_wsdl);
res = zend_register_resource(sdl, le_sdl);
add_property_resource(this_ptr, "sdl", res);
class SoapParam
{
- public function __construct($data, string $name) {}
+ public function __construct(mixed $data, string $name) {}
}
class SoapHeader
{
- public function __construct(string $namespace, string $name, $data = UNKNOWN, bool $mustunderstand = false, $actor = UNKNOWN) {}
+ public function __construct(string $namespace, string $name, mixed $data = UNKNOWN, bool $mustunderstand = false, string|int|null $actor = null) {}
}
class SoapFault extends Exception
{
- public function __construct($faultcode, string $faultstring, ?string $faultactor = null, $detail = null, ?string $faultname = null, $headerfault = null) {}
+ public function __construct(array|string|null $faultcode, string $faultstring, ?string $faultactor = null, mixed $detail = null, ?string $faultname = null, mixed $headerfault = null) {}
public function __toString(): string {}
}
class SoapVar
{
- public function __construct($data, $encoding, string $type_name = "", string $type_namespace = "", string $node_name = "", string $node_namespace = "") {}
+ public function __construct(mixed $data, ?int $encoding, string $type_name = "", string $type_namespace = "", string $node_name = "", string $node_namespace = "") {}
}
class SoapServer
{
- public function __construct($wsdl, array $options = []) {}
+ public function __construct(?string $wsdl, array $options = []) {}
/** @return void */
- public function fault(string $code, string $string, string $actor = "", $details = null, string $name = "") {}
+ public function fault(string $code, string $string, string $actor = "", mixed $details = null, string $name = "") {}
/** @return void */
public function addSoapHeader(SoapHeader $object) {}
public function setPersistence(int $mode) {}
/** @return void */
- public function setClass(string $class_name, ...$argv) {}
+ public function setClass(string $class_name, mixed ...$argv) {}
/** @return void */
public function setObject(object $object) {}
/** @return array */
public function getFunctions() {}
- /** @return void */
+ /**
+ * @param array|string|int $functions
+ * @return void
+ */
public function addFunction($functions) {}
/** @return void */
class SoapClient
{
- public function __construct($wsdl, array $options = []) {}
+ public function __construct(?string $wsdl, array $options = []) {}
/** @return mixed */
public function __call(string $function_name, array $arguments) {}
- /** @return mixed */
- public function __soapCall(string $function_name, array $arguments, ?array $options = null, $input_headers = null, $output_headers = null) {}
+ /**
+ * @param SoapHeader|array|null $input_headers
+ * @param array $output_headers
+ * @return mixed
+ */
+ public function __soapCall(string $function_name, array $arguments, ?array $options = null, $input_headers = null, &$output_headers = null) {}
/** @return array|null */
public function __getFunctions() {}
/** @return array */
public function __getCookies() {}
- /** @return bool */
+ /**
+ * @param SoapHeader|array|null $soapheaders
+ * @return bool
+ */
public function __setSoapHeaders($soapheaders = null) {}
/** @return string|null */
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 14076c21ac68b4d1e88c1067e7d1f87373f1669e */
+ * Stub hash: 75e1f968f03aacc08ad7858adff05040ed61e23d */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_use_soap_error_handler, 0, 0, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, handler, _IS_BOOL, 0, "true")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SoapParam___construct, 0, 0, 2)
- ZEND_ARG_INFO(0, data)
+ ZEND_ARG_TYPE_INFO(0, data, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SoapHeader___construct, 0, 0, 2)
ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
- ZEND_ARG_INFO(0, data)
+ ZEND_ARG_TYPE_INFO(0, data, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mustunderstand, _IS_BOOL, 0, "false")
- ZEND_ARG_INFO(0, actor)
+ ZEND_ARG_TYPE_MASK(0, actor, MAY_BE_STRING|MAY_BE_LONG|MAY_BE_NULL, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SoapFault___construct, 0, 0, 2)
- ZEND_ARG_INFO(0, faultcode)
+ ZEND_ARG_TYPE_MASK(0, faultcode, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_NULL, NULL)
ZEND_ARG_TYPE_INFO(0, faultstring, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, faultactor, IS_STRING, 1, "null")
- ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, detail, "null")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, detail, IS_MIXED, 0, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, faultname, IS_STRING, 1, "null")
- ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, headerfault, "null")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, headerfault, IS_MIXED, 0, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_SoapFault___toString, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SoapVar___construct, 0, 0, 2)
- ZEND_ARG_INFO(0, data)
- ZEND_ARG_INFO(0, encoding)
+ ZEND_ARG_TYPE_INFO(0, data, IS_MIXED, 0)
+ ZEND_ARG_TYPE_INFO(0, encoding, IS_LONG, 1)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type_name, IS_STRING, 0, "\"\"")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type_namespace, IS_STRING, 0, "\"\"")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, node_name, IS_STRING, 0, "\"\"")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SoapServer___construct, 0, 0, 1)
- ZEND_ARG_INFO(0, wsdl)
+ ZEND_ARG_TYPE_INFO(0, wsdl, IS_STRING, 1)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
ZEND_END_ARG_INFO()
ZEND_ARG_TYPE_INFO(0, code, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, actor, IS_STRING, 0, "\"\"")
- ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, details, "null")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, details, IS_MIXED, 0, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 0, "\"\"")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SoapServer_setClass, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, class_name, IS_STRING, 0)
- ZEND_ARG_VARIADIC_INFO(0, argv)
+ ZEND_ARG_VARIADIC_TYPE_INFO(0, argv, IS_MIXED, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SoapServer_setObject, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, arguments, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null")
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, input_headers, "null")
- ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, output_headers, "null")
+ ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, output_headers, "null")
ZEND_END_ARG_INFO()
#define arginfo_class_SoapClient___getFunctions arginfo_class_SoapServer_getFunctions
--FILE--
<?php
$fault = new SoapFault("", "message"); // Can't be an empty string
-$fault = new SoapFault(0, "message"); // Can't be a non-string (except for null)
+
+try {
+ new SoapFault(new stdClass(), "message"); // Can't be a non-string (except for null)
+} catch (TypeError $exception) {
+ echo $exception->getMessage() . "\n";
+}
+
$fault = new SoapFault("Sender", "message");
echo get_class($fault) . "\n";
$fault = new SoapFault(null, "message");
?>
--EXPECTF--
Warning: SoapFault::__construct(): Invalid fault code in %s on line %d
-
-Warning: SoapFault::__construct(): Invalid fault code in %s on line %d
+SoapFault::__construct(): Argument #1 ($faultcode) must be of type string|array|null, stdClass given
SoapFault
SoapFault
param.param_number = -1;
param.type = SQLITE3_TEXT;
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "lz|l", ¶m.param_number, ¶meter, ¶m.type) == FAILURE) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", ¶m.name, ¶meter, ¶m.type) == FAILURE) {
- RETURN_THROWS();
- }
- }
+ ZEND_PARSE_PARAMETERS_START(2, 3)
+ Z_PARAM_STR_OR_LONG(param.name, param.param_number)
+ Z_PARAM_ZVAL(parameter)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(param.type)
+ ZEND_PARSE_PARAMETERS_END();
SQLITE3_CHECK_INITIALIZED(stmt_obj->db_obj, stmt_obj->initialised, SQLite3);
SQLITE3_CHECK_INITIALIZED_STMT(stmt_obj->stmt, SQLite3Stmt);
/** @return mixed */
public function querySingle(string $query, bool $entire_row = false) {}
- /** @return bool */
+ /**
+ * @param callable $callback
+ * @return bool
+ */
public function createFunction(string $name, $callback, int $argument_count = -1, int $flags = 0) {}
- /** @return bool */
+ /**
+ * @param callable $step_callback
+ * @param callable $final_callback
+ * @return bool
+ */
public function createAggregate(string $name, $step_callback, $final_callback, int $argument_count = -1) {}
- /** @return bool */
+ /**
+ * @param callable $callback
+ * @return bool
+ */
public function createCollation(string $name, $callback) {}
/** @return resource|false */
private function __construct(SQLite3 $sqlite3, string $sql) {}
/** @return bool */
- public function bindParam($param_number, &$param, int $type = SQLITE3_TEXT) {}
+ public function bindParam(string|int $param_number, mixed &$param, int $type = SQLITE3_TEXT) {}
/** @return bool */
- public function bindValue($param_number, $param, int $type = SQLITE3_TEXT) {}
+ public function bindValue(string|int $param_number, mixed $param, int $type = SQLITE3_TEXT) {}
/** @return bool */
public function clear() {}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: ded6aa03b742cbcf95943a6acb1101a0b700f30c */
+ * Stub hash: cc36f3299089a453fac76179377b68647c33786c */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3Stmt_bindParam, 0, 0, 2)
- ZEND_ARG_INFO(0, param_number)
- ZEND_ARG_INFO(1, param)
+ ZEND_ARG_TYPE_MASK(0, param_number, MAY_BE_STRING|MAY_BE_LONG, NULL)
+ ZEND_ARG_TYPE_INFO(1, param, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "SQLITE3_TEXT")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SQLite3Stmt_bindValue, 0, 0, 2)
- ZEND_ARG_INFO(0, param_number)
- ZEND_ARG_INFO(0, param)
+ ZEND_ARG_TYPE_MASK(0, param_number, MAY_BE_STRING|MAY_BE_LONG, NULL)
+ ZEND_ARG_TYPE_INFO(0, param, IS_MIXED, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, type, IS_LONG, 0, "SQLITE3_TEXT")
ZEND_END_ARG_INFO()
/** @prefer-ref $array */
function extract(array &$array, int $extract_type = EXTR_OVERWRITE, string $prefix = ""): int {}
+/**
+ * @param string|array $var_name
+ * @param string|array $var_names
+ */
function compact($var_name, ...$var_names): array {}
function array_fill(int $start_key, int $num, mixed $val): array {}
function array_intersect_key(array $array1, array $array2, array ...$arrays): array {}
+/** @param array|callable $rest */
function array_intersect_ukey(array $array1, array $array2, ...$rest): array {}
function array_intersect(array $array1, array $array2, array ...$arrays): array {}
+/** @param array|callable $rest */
function array_uintersect(array $array1, array $array2, ...$rest): array {}
function array_intersect_assoc(array $array1, array $array2, array ...$arrays): array {}
+/** @param array|callable $rest */
function array_uintersect_assoc(array $array1, array $array2, ...$rest): array {}
+/** @param array|callable $rest */
function array_intersect_uassoc(array $array1, array $array2, ...$rest): array {}
+/** @param array|callable $rest */
function array_uintersect_uassoc(array $array1, array $array2, ...$rest): array {}
function array_diff_key(array $array1, array $array2, array ...$arrays): array {}
+/** @param array|callable $rest */
function array_diff_ukey(array $array1, array $array2, ...$rest): array {}
function array_diff(array $array1, array $array2, array ...$arrays): array {}
+/** @param array|callable $rest */
function array_udiff(array $array1, array $array2, ...$rest): array {}
function array_diff_assoc(array $array1, array $array2, array ...$arrays): array {}
+/** @param array|callable $rest */
function array_diff_uassoc(array $array1, array $array2, ...$rest): array {}
+/** @param array|callable $rest */
function array_udiff_assoc(array $array1, array $array2, ...$rest): array {}
+/** @param array|callable $rest */
function array_udiff_uassoc(array $array1, array $array2, ...$rest): array {}
/**
function lstat(string $filename): array|false {}
-function chown(string $filename, $user): bool {}
+function chown(string $filename, string|int $user): bool {}
-function chgrp(string $filename, $group): bool {}
+function chgrp(string $filename, string|int $group): bool {}
#if HAVE_LCHOWN
-function lchown(string $filename, $user): bool {}
+function lchown(string $filename, string|int $user): bool {}
-function lchgrp(string $filename, $group): bool {}
+function lchgrp(string $filename, string|int $group): bool {}
#endif
function chmod(string $filename, int $mode): bool {}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: a26e702dd4b4a98d07d5ed47ae622431ad373123 */
+ * Stub hash: 1c0060ad8608f5245e0b5319879b77510cb81683 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_chown, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
- ZEND_ARG_INFO(0, user)
+ ZEND_ARG_TYPE_MASK(0, user, MAY_BE_STRING|MAY_BE_LONG, NULL)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_chgrp, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
- ZEND_ARG_INFO(0, group)
+ ZEND_ARG_TYPE_MASK(0, group, MAY_BE_STRING|MAY_BE_LONG, NULL)
ZEND_END_ARG_INFO()
#if HAVE_LCHOWN
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_lchown, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
- ZEND_ARG_INFO(0, user)
+ ZEND_ARG_TYPE_MASK(0, user, MAY_BE_STRING|MAY_BE_LONG, NULL)
ZEND_END_ARG_INFO()
#endif
#if HAVE_LCHOWN
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_lchgrp, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
- ZEND_ARG_INFO(0, group)
+ ZEND_ARG_TYPE_MASK(0, group, MAY_BE_STRING|MAY_BE_LONG, NULL)
ZEND_END_ARG_INFO()
#endif
{
char *filename;
size_t filename_len;
- zval *group;
+ zend_string *group_str;
+ zend_long group_long;
#if !defined(WINDOWS)
gid_t gid;
int ret;
ZEND_PARSE_PARAMETERS_START(2, 2)
Z_PARAM_PATH(filename, filename_len)
- Z_PARAM_ZVAL(group)
+ Z_PARAM_STR_OR_LONG(group_str, group_long)
ZEND_PARSE_PARAMETERS_END();
wrapper = php_stream_locate_url_wrapper(filename, NULL, 0);
if(wrapper && wrapper->wops->stream_metadata) {
int option;
void *value;
- if (Z_TYPE_P(group) == IS_LONG) {
- option = PHP_STREAM_META_GROUP;
- value = &Z_LVAL_P(group);
- } else if (Z_TYPE_P(group) == IS_STRING) {
+ if (group_str) {
option = PHP_STREAM_META_GROUP_NAME;
- value = Z_STRVAL_P(group);
+ value = ZSTR_VAL(group_str);
} else {
- zend_argument_type_error(2, "must be of type string|int, %s given", zend_zval_type_name(group));
- RETURN_THROWS();
+ option = PHP_STREAM_META_GROUP;
+ value = &group_long;
}
+
if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL)) {
RETURN_TRUE;
} else {
/* We have no native chgrp on Windows, nothing left to do if stream doesn't have own implementation */
RETURN_FALSE;
#else
- if (Z_TYPE_P(group) == IS_LONG) {
- gid = (gid_t)Z_LVAL_P(group);
- } else if (Z_TYPE_P(group) == IS_STRING) {
- if(php_get_gid_by_name(Z_STRVAL_P(group), &gid) != SUCCESS) {
- php_error_docref(NULL, E_WARNING, "Unable to find gid for %s", Z_STRVAL_P(group));
+ if (group_str) {
+ if (php_get_gid_by_name(ZSTR_VAL(group_str), &gid) != SUCCESS) {
+ php_error_docref(NULL, E_WARNING, "Unable to find gid for %s", ZSTR_VAL(group_str));
RETURN_FALSE;
}
} else {
- zend_argument_type_error(2, "must be of type string|int, %s given", zend_zval_type_name(group));
- RETURN_THROWS();
+ gid = (gid_t) group_long;
}
/* Check the basedir */
#if HAVE_LCHOWN
PHP_FUNCTION(lchgrp)
{
-# if !defined(WINDOWS)
php_do_chgrp(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
-# else
- RETURN_FALSE;
-# endif
}
#endif
/* }}} */
{
char *filename;
size_t filename_len;
- zval *user;
+ zend_string *user_str;
+ zend_long user_long;
#if !defined(WINDOWS)
uid_t uid;
int ret;
ZEND_PARSE_PARAMETERS_START(2, 2)
Z_PARAM_PATH(filename, filename_len)
- Z_PARAM_ZVAL(user)
+ Z_PARAM_STR_OR_LONG(user_str, user_long)
ZEND_PARSE_PARAMETERS_END();
wrapper = php_stream_locate_url_wrapper(filename, NULL, 0);
if(wrapper && wrapper->wops->stream_metadata) {
int option;
void *value;
- if (Z_TYPE_P(user) == IS_LONG) {
- option = PHP_STREAM_META_OWNER;
- value = &Z_LVAL_P(user);
- } else if (Z_TYPE_P(user) == IS_STRING) {
+ if (user_str) {
option = PHP_STREAM_META_OWNER_NAME;
- value = Z_STRVAL_P(user);
+ value = ZSTR_VAL(user_str);
} else {
- php_error_docref(NULL, E_WARNING, "Parameter 2 should be string or int, %s given", zend_zval_type_name(user));
- RETURN_FALSE;
+ option = PHP_STREAM_META_OWNER;
+ value = &user_long;
}
+
if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
#else
- if (Z_TYPE_P(user) == IS_LONG) {
- uid = (uid_t)Z_LVAL_P(user);
- } else if (Z_TYPE_P(user) == IS_STRING) {
- if(php_get_uid_by_name(Z_STRVAL_P(user), &uid) != SUCCESS) {
- php_error_docref(NULL, E_WARNING, "Unable to find uid for %s", Z_STRVAL_P(user));
+ if (user_str) {
+ if (php_get_uid_by_name(ZSTR_VAL(user_str), &uid) != SUCCESS) {
+ php_error_docref(NULL, E_WARNING, "Unable to find uid for %s", ZSTR_VAL(user_str));
RETURN_FALSE;
}
} else {
- php_error_docref(NULL, E_WARNING, "Parameter 2 should be string or int, %s given", zend_zval_type_name(user));
- RETURN_FALSE;
+ uid = (uid_t) user_long;
}
/* Check the basedir */
#if HAVE_LCHOWN
PHP_FUNCTION(lchown)
{
-# if !defined(WINDOWS)
RETVAL_TRUE;
php_do_chown(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
-# else
- RETURN_FALSE;
-# endif
}
#endif
/* }}} */
echo $exception->getMessage() . "\n";
}
?>
---EXPECT--
-chgrp(): Argument #2 ($group) must be of type string|int, null given
+--EXPECTF--
+Warning: chgrp(): No such file or directory in %s on line %d
echo "ALIVE\n";
?>
--EXPECTF--
-Warning: chown(): Parameter 2 should be string or int, null given in %schown.php on line %d
+Warning: chown(): No such file or directory in %s on line %d
ALIVE
}
?>
--EXPECTF--
-Fatal error: Declaration of bar::filter($in, $out, &$consumed) must be compatible with php_user_filter::filter($in, $out, &$consumed, $closing) in %s on line %d
+Fatal error: Declaration of bar::filter($in, $out, &$consumed) must be compatible with php_user_filter::filter($in, $out, &$consumed, bool $closing) in %s on line %d
}
?>
--EXPECTF--
-Fatal error: Declaration of foo::filter($in, $out, $consumed, $closing) must be compatible with php_user_filter::filter($in, $out, &$consumed, $closing) in %s on line %d
+Fatal error: Declaration of foo::filter($in, $out, $consumed, $closing) must be compatible with php_user_filter::filter($in, $out, &$consumed, bool $closing) in %s on line %d
PHP_METHOD(php_user_filter, filter)
{
- zval *in, *out, *consumed, *closing;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzzz", &in, &out, &consumed, &closing) == FAILURE) {
+ zval *in, *out, *consumed;
+ zend_bool closing;
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrzb", &in, &out, &consumed, &closing) == FAILURE) {
RETURN_THROWS();
}
}
class php_user_filter
{
- /** @return int */
- public function filter($in, $out, &$consumed, $closing) {}
+ /**
+ * @param resource $in
+ * @param resource $out
+ * @param int $consumed
+ * @return int
+ */
+ public function filter($in, $out, &$consumed, bool $closing) {}
/** @return void */
public function onCreate() {}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 1c95e4944aab77be8b65da8a6877738b1f061b69 */
+ * Stub hash: b3876ce9055a9417d0d1db9f97235513740de956 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_php_user_filter_filter, 0, 0, 4)
ZEND_ARG_INFO(0, in)
ZEND_ARG_INFO(0, out)
ZEND_ARG_INFO(1, consumed)
- ZEND_ARG_INFO(0, closing)
+ ZEND_ARG_TYPE_INFO(0, closing, _IS_BOOL, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_php_user_filter_onCreate, 0, 0, 0)
/** @return bool */
public function setExternalAttributesIndex(int $index, int $opsys, int $attr, int $flags = 0) {}
- /** @return bool */
+ /**
+ * @param int $opsys
+ * @param int $attr
+ * @return bool
+ */
public function getExternalAttributesName(string $name, &$opsys, &$attr, int $flags = 0) {}
- /** @return bool */
+ /**
+ * @param int $opsys
+ * @param int $attr
+ * @return bool
+ */
public function getExternalAttributesIndex(int $index, &$opsys, &$attr, int $flags = 0) {}
#endif
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 95608dd1d6c2ad80ada990a9e939b76dba705d48 */
+ * Stub hash: 880148896a71ad9bd076bb42c735ff1b83cd0731 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_zip_open, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)