mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Is it still necessary to wrap the __clone implementation in an if check? #6524
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sirdiego on GitHub (Aug 24, 2020).
The documentation says that __clone (and __wakeup) are not save to implement without an id check. But the Instantiator has an isSafeToClone method that checks if there is an __clone method implemented. So is it still necessary to wrap the __clone into the id check?
Thanks!
@beberlei commented on GitHub (Sep 13, 2020):
@sirdiego No, its not necessary anymore, that was before
ReflectionClass::newInstanceWithoutConstructorwas added in PHP 5.4 or 5.5