# [RFC] Prevent instantiation and cloning of __PHP_Incomplete_Class

- Thread: https://externals.io/message/130267
- Original archive: https://news-web.php.net/php.internals/130267
- Started by tim@bastelstu.be on 2026-03-07T21:37:21+00:00
- Messages: 1
- RFC: Prevent instantiation and cloning of __PHP_Incomplete_Class (Under discussion) — https://externals.io/rfc/deprecate-incomplete-class-instantiation.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #130267 — tim@bastelstu.be — 2026-03-07T21:37:21+00:00

URL: https://externals.io/message/130267#130267

Hi


> I would like to propose a new RFC titled “Prevent instantiation and cloning of __PHP_Incomplete_Class”.
> 
> RFC: https://wiki.php.net/rfc/deprecate-incomplete-class-instantiation
> Implementation PR: https://github.com/php/php-src/pull/21325
> 
> This RFC proposes to disallow direct instantiation and cloning of the internal class __PHP_Incomplete_Class.

I don't find the motivation particularly compelling. Yes, manually 
instantiating the class is not particularly useful, but it's also not 
harmful. Similarly for cloning: If the cloning operation works correctly 
(i.e. it returning a new object with the same state), then it is just 
behaving according to expectations.

On the contrary, I would like to see fewer behavioral differences 
between internal classes and userland classes. A class that can only be 
instantiated by the engine without there being a good engine-related 
reason is yet another special case that users need to learn about.

Best regards
Tim Düsterhus

PS: Unserialization for unknown classes should just throw an Exception.
