zend_ffi_cdata *cdata;
zend_ffi_type *type;
void *ptr;
- zend_long size = 0;
+ zend_long size;
+ zend_bool size_is_null = 1;
ZEND_FFI_VALIDATE_API_RESTRICTION();
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_OBJECT_OF_CLASS_EX2(zv, zend_ffi_cdata_ce, 0, 1, 0);
Z_PARAM_OPTIONAL
- Z_PARAM_LONG(size)
+ Z_PARAM_LONG_OR_NULL(size, size_is_null)
ZEND_PARSE_PARAMETERS_END();
cdata = (zend_ffi_cdata*)Z_OBJ_P(zv);
type = ZEND_FFI_TYPE(cdata->type);
- if (EX_NUM_ARGS() == 2) {
+ if (!size_is_null) {
if (type->kind == ZEND_FFI_TYPE_POINTER) {
ptr = *(void**)cdata->ptr;
} else {
public static function memset(FFI\CData $ptr, int $ch, int $size): void {}
/** @prefer-ref $ptr */
- public static function string(FFI\CData $ptr, int $size = UNKNOWN): ?string {}
+ public static function string(FFI\CData $ptr, ?int $size = null): ?string {}
/** @prefer-ref $ptr */
public static function isNull(FFI\CData $ptr): bool {}
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_string, 0, 1, IS_STRING, 1)
ZEND_ARG_OBJ_INFO(ZEND_SEND_PREFER_REF, ptr, FFI\\CData, 0)
- ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, size, IS_LONG, 1, "null")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_FFI_isNull, 0, 1, _IS_BOOL, 0)
if (zend_parse_method_parameters(
ZEND_NUM_ARGS(), object, "Oll|llll",
- &object, Calendar_ce_ptr, &args[0], &args[1], &args[2], &args[3], &args[4], &args[5]) == FAILURE
- ) {
+ &object, Calendar_ce_ptr, &args[0], &args[1], &args[2], &args[3], &args[4], &args[5]
+ ) == FAILURE) {
RETURN_THROWS();
}
for (int i = 0; i < arg_num; i++) {
if (args[i] < INT32_MIN || args[i] > INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
- "intlcal_set: at least one of the arguments has an absolute "
- "value that is too large", 0);
+ "intlcal_set: at least one of the arguments has an absolute value that is too large", 0);
RETURN_FALSE;
}
}
* @return string|false
* @alias datefmt_get_locale
*/
- public function getLocale(int $which = UNKNOWN) {}
+ public function getLocale(int $which = ULOC_ACTUAL_LOCALE) {}
/**
* @return void
#define arginfo_class_IntlDateFormatter_getPattern arginfo_class_IntlDateFormatter_getDateType
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter_getLocale, 0, 0, 0)
- ZEND_ARG_TYPE_INFO(0, which, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, which, IS_LONG, 0, "ULOC_ACTUAL_LOCALE")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlDateFormatter_setLenient, 0, 0, 1)
function datefmt_get_pattern(IntlDateFormatter $df): string|false {}
-function datefmt_get_locale(IntlDateFormatter $df, int $which = UNKNOWN): string|false {}
+function datefmt_get_locale(IntlDateFormatter $df, int $which = ULOC_ACTUAL_LOCALE): string|false {}
function datefmt_set_lenient(IntlDateFormatter $df, bool $lenient): void {}
#if U_ICU_VERSION_MAJOR_NUM >= 52
function intltz_get_windows_id(string $timezone): string|false {}
-function intltz_get_id_for_windows_id(string $timezone, string $region = UNKNOWN): string|false {}
+function intltz_get_id_for_windows_id(string $timezone, ?string $region = null): string|false {}
#endif
function intltz_has_same_rules(IntlTimeZone $tz, IntlTimeZone $otherTimeZone): bool {}
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_datefmt_get_locale, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_OBJ_INFO(0, df, IntlDateFormatter, 0)
- ZEND_ARG_TYPE_INFO(0, which, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, which, IS_LONG, 0, "ULOC_ACTUAL_LOCALE")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_datefmt_set_lenient, 0, 2, IS_VOID, 0)
#if U_ICU_VERSION_MAJOR_NUM >= 52
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_intltz_get_id_for_windows_id, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, timezone, IS_STRING, 0)
- ZEND_ARG_TYPE_INFO(0, region, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, region, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()
#endif
* @return string|false
* @alias intltz_get_id_for_windows_id
*/
- public static function getIDForWindowsID(string $timezone, string $region = UNKNOWN) {}
+ public static function getIDForWindowsID(string $timezone, ?string $region = null) {}
#endif
/**
* @return bool
#if U_ICU_VERSION_MAJOR_NUM >= 52
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_IntlTimeZone_getIDForWindowsID, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, timezone, IS_STRING, 0)
- ZEND_ARG_TYPE_INFO(0, region, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, region, IS_STRING, 1, "null")
ZEND_END_ARG_INFO()
#endif
UnicodeString uWinID, uID;
UErrorCode error;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|S", &winID, ®ion) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|S!", &winID, ®ion) == FAILURE) {
RETURN_THROWS();
}
* @return object|null
* @alias mysqli_fetch_object
*/
- public function fetch_object(string $class_name = UNKNOWN, array $params = []) {}
+ public function fetch_object(string $class_name = "stdClass", array $params = []) {}
/**
* @return array|null
function mysqli_fetch_assoc(mysqli_result $mysql_result): ?array {}
-function mysqli_fetch_object(
- mysqli_result $mysqli_result,
- string $class_name = UNKNOWN,
- array $params = []
-): ?object {}
+function mysqli_fetch_object(mysqli_result $mysqli_result, string $class_name = "stdClass", array $params = []): ?object {}
function mysqli_fetch_row(mysqli_result $mysqli_result): ?array {}
function mysqli_get_charset(mysqli $mysqli_link): ?object {}
-function mysqli_get_client_info(mysqli $mysqli_link = UNKNOWN): ?string {}
+function mysqli_get_client_info(?mysqli $mysqli_link = null): ?string {}
function mysqli_get_client_version(): int {}
} else {
zval *mysql_link;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|O!", &mysql_link, mysqli_link_class_entry) == FAILURE) {
RETURN_THROWS();
}
}
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_fetch_object, 0, 1, IS_OBJECT, 1)
ZEND_ARG_OBJ_INFO(0, mysqli_result, mysqli_result, 0)
- ZEND_ARG_TYPE_INFO(0, class_name, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, class_name, IS_STRING, 0, "\"stdClass\"")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, params, IS_ARRAY, 0, "[]")
ZEND_END_ARG_INFO()
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_get_client_info, 0, 0, IS_STRING, 1)
- ZEND_ARG_OBJ_INFO(0, mysqli_link, mysqli, 0)
+ ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, mysqli_link, mysqli, 1, "null")
ZEND_END_ARG_INFO()
#define arginfo_mysqli_get_client_version arginfo_mysqli_connect_errno
#define arginfo_class_mysqli_result_fetch_assoc arginfo_class_mysqli_character_set_name
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_fetch_object, 0, 0, 0)
- ZEND_ARG_TYPE_INFO(0, class_name, IS_STRING, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, class_name, IS_STRING, 0, "\"stdClass\"")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, params, IS_ARRAY, 0, "[]")
ZEND_END_ARG_INFO()
PHP_FUNCTION(pcntl_getpriority)
{
zend_long who = PRIO_PROCESS;
- zend_long pid = getpid();
+ zend_long pid;
+ zend_bool pid_is_null = 1;
int pri;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ll", &pid, &who) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!l", &pid, &who) == FAILURE) {
RETURN_THROWS();
}
/* needs to be cleared, since any returned value is valid */
errno = 0;
- pri = getpriority(who, pid);
+ pri = getpriority(who, pid_is_null ? getpid() : pid);
if (errno) {
PCNTL_G(last_error) = errno;
PHP_FUNCTION(pcntl_setpriority)
{
zend_long who = PRIO_PROCESS;
- zend_long pid = getpid();
+ zend_long pid;
+ zend_bool pid_is_null = 1;
zend_long pri;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|ll", &pri, &pid, &who) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l!l", &pri, &pid, &who) == FAILURE) {
RETURN_THROWS();
}
- if (setpriority(who, pid, pri)) {
+ if (setpriority(who, pid_is_null ? getpid() : pid, pri)) {
PCNTL_G(last_error) = errno;
switch (errno) {
case ESRCH:
Enable/disable asynchronous signal handling and return the old setting. */
PHP_FUNCTION(pcntl_async_signals)
{
- zend_bool on;
+ zend_bool on, on_is_null = 1;
- if (ZEND_NUM_ARGS() == 0) {
- RETURN_BOOL(PCNTL_G(async_signals));
- }
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &on) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b!", &on, &on_is_null) == FAILURE) {
RETURN_THROWS();
}
+
+ if (on_is_null) {
+ RETURN_BOOL(PCNTL_G(async_signals));
+ }
+
RETVAL_BOOL(PCNTL_G(async_signals));
PCNTL_G(async_signals) = on;
}
function pcntl_errno(): int {}
#ifdef HAVE_GETPRIORITY
-function pcntl_getpriority(int $pid = UNKNOWN, int $process_identifier = PRIO_PROCESS): int|false {}
+function pcntl_getpriority(?int $pid = null, int $process_identifier = PRIO_PROCESS): int|false {}
#endif
#ifdef HAVE_SETPRIORITY
-function pcntl_setpriority(int $priority, int $pid = UNKNOWN, int $process_identifier = PRIO_PROCESS): bool{}
+function pcntl_setpriority(int $priority, ?int $pid = null, int $process_identifier = PRIO_PROCESS): bool{}
#endif
function pcntl_strerror(int $errno): string {}
-function pcntl_async_signals(bool $on = UNKNOWN): bool {}
+function pcntl_async_signals(?bool $on = null): bool {}
#ifdef HAVE_UNSHARE
function pcntl_unshare(int $flags): bool {}
#if defined(HAVE_GETPRIORITY)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_pcntl_getpriority, 0, 0, MAY_BE_LONG|MAY_BE_FALSE)
- ZEND_ARG_TYPE_INFO(0, pid, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pid, IS_LONG, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, process_identifier, IS_LONG, 0, "PRIO_PROCESS")
ZEND_END_ARG_INFO()
#endif
#if defined(HAVE_SETPRIORITY)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_setpriority, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, priority, IS_LONG, 0)
- ZEND_ARG_TYPE_INFO(0, pid, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, pid, IS_LONG, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, process_identifier, IS_LONG, 0, "PRIO_PROCESS")
ZEND_END_ARG_INFO()
#endif
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_pcntl_async_signals, 0, 0, _IS_BOOL, 0)
- ZEND_ARG_TYPE_INFO(0, on, _IS_BOOL, 0)
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, on, _IS_BOOL, 1, "null")
ZEND_END_ARG_INFO()
#if defined(HAVE_UNSHARE)