#214 (comment):
... PHP 7.4 changed the behavior of anonymous classes with respect to get_declared_classes(). It seems that since 7.4.0, there are more conditions on an anonymous class being added to get_declared_classes() (i.e. to the list returned by this function). Specifically, it might not be added if it is never instantiated, even if it is in a file that was compiled. Therefore Patchwork's wildcards (like redefine('*::__construct', ...)) theoretically allow capturing anonymous classes across all supported PHP versions, but since PHP 7.4 this works unreliably.
#214 (comment):