Closes GH-4523.
#include <sys/sem.h>
#include <errno.h>
+#include "sysvsem_arginfo.h"
#include "php_sysvsem.h"
#include "ext/standard/info.h"
#endif
-/* {{{ arginfo */
-ZEND_BEGIN_ARG_INFO_EX(arginfo_sem_get, 0, 0, 1)
- ZEND_ARG_INFO(0, key)
- ZEND_ARG_INFO(0, max_acquire)
- ZEND_ARG_INFO(0, perm)
- ZEND_ARG_INFO(0, auto_release)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_sem_acquire, 0, 0, 1)
- ZEND_ARG_INFO(0, sem_identifier)
- ZEND_ARG_INFO(0, nowait)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_sem_release, 0, 0, 1)
- ZEND_ARG_INFO(0, sem_identifier)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_sem_remove, 0, 0, 1)
- ZEND_ARG_INFO(0, sem_identifier)
-ZEND_END_ARG_INFO()
-/* }}} */
-
/* {{{ sysvsem_functions[]
*/
static const zend_function_entry sysvsem_functions[] = {
--- /dev/null
+<?php
+
+/**
+ * @todo use bool for $auto_release
+ * @return resource|false
+ */
+function sem_get(int $key, int $max_acquire = 1, int $perm = 0666, int $auto_release = 1) {}
+
+/**
+ * @param resource $sem_identifier
+ */
+function sem_acquire($sem_identifier, bool $nowait = false): bool {}
+
+/**
+ * @param resource $sem_identifier
+ */
+function sem_release($sem_identifier): bool {}
+
+/**
+ * @param resource $sem_identifier
+ */
+function sem_remove($sem_identifier): bool {}
--- /dev/null
+/* This is a generated file, edit the .stub.php file instead. */
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_sem_get, 0, 0, 1)
+ ZEND_ARG_TYPE_INFO(0, key, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, max_acquire, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, perm, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, auto_release, IS_LONG, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sem_acquire, 0, 1, _IS_BOOL, 0)
+ ZEND_ARG_INFO(0, sem_identifier)
+ ZEND_ARG_TYPE_INFO(0, nowait, _IS_BOOL, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sem_release, 0, 1, _IS_BOOL, 0)
+ ZEND_ARG_INFO(0, sem_identifier)
+ZEND_END_ARG_INFO()
+
+#define arginfo_sem_remove arginfo_sem_release