---
title: "[RFC] [Discussion] Serializable closures from constant expressions"
url: https://daily.dev/posts/rfc-discussion-serializable-closures-from-constant-expressions-9co5vhr3z
source_url: https://externals.io/message/131758
type: article
source: "externals.io"
published: 2026-07-04T09:43:28.240Z
updated: 2026-07-04T09:43:46.867Z
tags: ["php"]
reading_time: 11
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# [RFC] [Discussion] Serializable closures from constant expressions

**[externals.io](https://daily.dev/sources/externals)** · 11 min read · 0 upvotes · 0 comments

## Summary

A PHP internals RFC discussion proposes making closures from constant expressions (introduced in PHP 8.5 for attribute arguments and parameter defaults) serializable. Currently these static, capture-nothing closures silently break serialize()-based metadata caches. The RFC proposes serializing them as references to their declaration site using a member@callable identifier format. Key discussion points include the security model (restricting deserialization to declared closures as defense-in-depth against call gadgets), serialization format stability across code changes, handling of private method access during unserialization, and whether to split the RFC or offer a reflection-only variant without the serialize() integration.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://externals.io/message/131758>

## Similar posts on daily.dev

- [\[RFC\] \[Discussion\] Serializable closures from constant expressions](https://daily.dev/posts/rfc-discussion-serializable-closures-from-constant-expressions-2mu3happt) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] \[Discussion\] Serializable closures from constant expressions](https://daily.dev/posts/rfc-discussion-serializable-closures-from-constant-expressions-0gkdwjswt) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] \[Discussion\] Serializable closures from constant expressions](https://daily.dev/posts/rfc-discussion-serializable-closures-from-constant-expressions-tv82jlg7s) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] \[Discussion\] Serializable closures from constant expressions](https://daily.dev/posts/rfc-discussion-serializable-closures-from-constant-expressions-vpkkj7paf) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] \[Discussion\] Serializable closures from constant expressions](https://daily.dev/posts/rfc-discussion-serializable-closures-from-constant-expressions-vflymqvec) · externals.io · 0 upvotes · 0 comments

---

Tags: [#php](https://daily.dev/tags/php)

[View this post on daily.dev](https://daily.dev/posts/rfc-discussion-serializable-closures-from-constant-expressions-9co5vhr3z)
