-
-
Notifications
You must be signed in to change notification settings - Fork 205
Milestone
Description
Directly calling __clone is allowed
Doing calls like $obj->__clone() is now allowed. This was the only magic method that had a compile-time check preventing some calls to it, which doesn't make sense. If we allow all other magic methods to be called, there's no reason to forbid this one.
Ref: https://wiki.php.net/rfc/abstract_syntax_tree#directly_calling_clone_is_allowed
Verified: https://3v4l.org/sqlsS
This is a bit hidden away in a RFC and not even mentioned in the changelogs in the manual, but it's a change in PHP behaviour and should not be that difficult to sniff out.
Reactions are currently unavailable