On 27.09.2024 at 14:32, Jonathan Vollebregt wrote:

> Long story short I'd like to suggest:
>
> 1. Allow the engine to call protected destructors (again)
> 2. Warning when declaring a private destructor as with other magic methods
> 3. Documentation update to confirm private destructors aren't allowed
>
> Does this sound good?

Hmm, I wonder about the use-cases of userland destructors.  It seems to
me they are mostly useful for sanity checks, and maybe to close
resources.  Are there others?

If not, I wouldn't worry much about the visibility of destructors,
because resources are scheduled for replacement anyway.

And since manually calling magic methods came up in the ticket: in my
opinion, whenever you have `->__` in production code, you're doing
something wrong.

Christoph

Reply via email to