Document that constant & defined work with enums
The constant() & defined() methods can be used with dynamic enum cases names, which doesn't seem to be documented anywhere at the moment.
Thank you for the PR!
I'm not sure if we need to explicitly document this, since it is already documented:
Because cases are represented as constants on the enum itself, they may be used as static values in most constant expressions: […]
@Crell, @iluuu1994, what do you think?
TBF this is the first user contributed note of the enum documentation:
https://www.php.net/manual/en/language.enumerations.basics.php

So this doesn't seem obvious to everyone.
@cmb69
Because cases are represented as constants on the enum itself, they may be used as static values in most constant expressions: […]
That really refers to enums being valid in other constant expressions, so things like:
const BAR = Foo::Bar;
I'm not against noting this, although my gut sense is that if you need this, you probably are doing something wrong and should be using a Backed enum instead. I'd be more comfortable if the addition on the enum paged included something to that effect.
@Crell While I agree with you that most of the time there's probably a better way to do this, it would still be good to have this documented as I have seen it being used for certain cases. I've added a note saying it's discouraged to use this method though.
Thanks all! Okay, so let's document this. I don't think the changelog entries make much sense, though, since enums are generally only available as of PHP 8.1, so there is not much point in hinting at particular changes regarding constant()/defined().
@cmb69 Good point, removed https://github.com/php/doc-en/compare/146e4425160cfbe3ca5db0fd971f19e53398be6e..5e5166663a1cbad952cb6c0acae30095e1d016bc