From 6da38d5c6df0eb02e8da62e010b276b684f77964 Mon Sep 17 00:00:00 2001
From: qodelicious <162776175+qodelicious@users.noreply.github.com>
Date: Sun, 18 Oct 2026 06:25:43 +0000
Subject: [PATCH 1/2] sem_get(): warn that auto_release also applies when the
semaphore is freed
Fixes #3612
---
reference/sem/functions/sem-get.xml | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/reference/sem/functions/sem-get.xml b/reference/sem/functions/sem-get.xml
index 01d99641a2a0..f0dbcdc0fbdf 100644
--- a/reference/sem/functions/sem-get.xml
+++ b/reference/sem/functions/sem-get.xml
@@ -120,6 +120,15 @@
otherwise PHP will be unable to access the semaphore.
+
+
+ If auto_release is enabled, the semaphore is also
+ released as soon as the SysvSemaphore object is freed,
+ for example when the variable holding it is unset, overwritten or goes out
+ of scope, not only on request shutdown. Keep a reference to the object for
+ as long as the semaphore needs to stay acquired.
+
+
From 0c186dd4b4280d2a775db7b638ac91f38dbb3c8a Mon Sep 17 00:00:00 2001
From: qodelicious <162776175+qodelicious@users.noreply.github.com>
Date: Mon, 19 Oct 2026 09:06:07 +0000
Subject: [PATCH 2/2] Apply review suggestion
---
reference/sem/functions/sem-get.xml | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/reference/sem/functions/sem-get.xml b/reference/sem/functions/sem-get.xml
index f0dbcdc0fbdf..861251adc9c7 100644
--- a/reference/sem/functions/sem-get.xml
+++ b/reference/sem/functions/sem-get.xml
@@ -122,11 +122,11 @@
- If auto_release is enabled, the semaphore is also
- released as soon as the SysvSemaphore object is freed,
- for example when the variable holding it is unset, overwritten or goes out
- of scope, not only on request shutdown. Keep a reference to the object for
- as long as the semaphore needs to stay acquired.
+ If auto_release is enabled, the acquisitions held by a
+ SysvSemaphore object are also released as soon as the
+ object is freed, for example when the variable holding it is unset,
+ overwritten or goes out of scope, not only on request shutdown. Keep a
+ reference to the object for as long as the semaphore needs to stay acquired.