. sem_get() will now return an SysvSemaphore object rather than a resource.
Return value checks using is_resource() should be replaced with checks
for `false`.
+ . The $auto_release parameter of sem_get() was changed to accept bool values
+ rather than int.
- Sysvshm:
. shm_attach() will now return an SysvSharedMemory object rather than a resource.
array_diff($array, ...$excludes);
// OK even if $arrays only contains a single array.
array_intersect(...$arrays);
+ . The $flag parameter of ob_implicit_flush() was changed to accept bool
+ values rather than int.
- Zip:
. Extension updated to version 1.19.0
function ob_get_status(bool $full_status = false): array {}
-// TODO: Shouldn't this be a bool argument?
-function ob_implicit_flush(int $flag = 1): void {}
+function ob_implicit_flush(bool $flag = true): void {}
function output_reset_rewrite_vars(): bool {}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 8f80246569ba9de48eebc8b68f476723f78b8f77 */
+ * Stub hash: df6d5ebb0449274b94f1e8707ab54978fd4b7d2f */
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_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ob_implicit_flush, 0, 0, IS_VOID, 0)
- ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flag, IS_LONG, 0, "1")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flag, _IS_BOOL, 0, "true")
ZEND_END_ARG_INFO()
#define arginfo_output_reset_rewrite_vars arginfo_ob_flush
/* {{{ Return an id for the semaphore with the given key, and allow max_acquire (default 1) processes to acquire it simultaneously */
PHP_FUNCTION(sem_get)
{
- zend_long key, max_acquire = 1, perm = 0666, auto_release = 1;
+ zend_long key, max_acquire = 1, perm = 0666;
+ zend_bool auto_release = 1;
int semid;
struct sembuf sop[3];
int count;
sysvsem_sem *sem_ptr;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l|lll", &key, &max_acquire, &perm, &auto_release)) {
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "l|llb", &key, &max_acquire, &perm, &auto_release)) {
RETURN_THROWS();
}
sem_ptr->key = key;
sem_ptr->semid = semid;
sem_ptr->count = 0;
- sem_ptr->auto_release = auto_release;
+ sem_ptr->auto_release = (int) auto_release;
}
/* }}} */
{
}
-/**
- * @todo use bool for $auto_release
- */
-function sem_get(int $key, int $max_acquire = 1, int $perm = 0666, int $auto_release = 1): SysvSemaphore|false {}
+function sem_get(int $key, int $max_acquire = 1, int $perm = 0666, bool $auto_release = true): SysvSemaphore|false {}
function sem_acquire(SysvSemaphore $semaphore, bool $nowait = false): bool {}
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: a9de9877facd28112e1fe21cf7c6f1c7fdc8014d */
+ * Stub hash: d00524488977b77475f9aa78c132a6dd53ab4dd0 */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_sem_get, 0, 1, SysvSemaphore, MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, key, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, max_acquire, IS_LONG, 0, "1")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, perm, IS_LONG, 0, "0666")
- ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, auto_release, IS_LONG, 0, "1")
+ ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, auto_release, _IS_BOOL, 0, "true")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sem_acquire, 0, 1, _IS_BOOL, 0)
{
zend_long flag = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flag) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &flag) == FAILURE) {
RETURN_THROWS();
}
- php_output_set_implicit_flush(flag);
+ php_output_set_implicit_flush((int) flag);
}
/* }}} */