[doc-en] master: Closure: Mention non-serializability of Closure objects (#5363)
| From: | Mikhail Alferov via GitHub | Date: | Sat, 16 May 2026 08:09:22 +0000 |
| Subject: | [doc-en] master: Closure: Mention non-serializability of Closure objects (#5363) | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-23314@lists.php.net to get a copy of this message | ||
Author: Mikhail Alferov (mmalferov)
Committer: GitHub (web-flow)
Pusher: jordikroon
Date: 2026-05-16T10:09:19+02:00
Commit: https://github.com/php/doc-en/commit/a97672ab04d97f510faee2abe8d961014f77f96d
Raw diff: https://github.com/php/doc-en/commit/a97672ab04d97f510faee2abe8d961014f77f96d.diff
Closure: Mention non-serializability of Closure objects (#5363)
* Mention non-serializability of Closure objects
Co-authored-by: Jordi Kroon <jordi@jordikroon.nl>
Changed paths:
M language/predefined/closure.xml
Diff:
diff --git a/language/predefined/closure.xml b/language/predefined/closure.xml
index 246019789b89..dafaee47dbfd 100644
--- a/language/predefined/closure.xml
+++ b/language/predefined/closure.xml
@@ -76,6 +76,17 @@
</informaltable>
</section>
+ <section role="notes">
+ &reftitle.notes;
+ <note>
+ <simpara>
+ <classname>Closure</classname> objects cannot be serialized
+ as closures may contain bound variables and a specific execution context.
+ Attempting to serialize a closure will throw an
<exceptionname>Exception</exceptionname>.
+ </simpara>
+ </note>
+ </section>
+
</partintro>
&language.predefined.closure.construct;