Re: Changing the generated name for anon classes

This is only part of a thread. view whole thread
February 6, 2020 20:08 (Andrea Faulds)

Nikita Popov wrote:
> Hi internals, > > Based on a suggestion by Nicolas Grekas, > changes the generated name for > anonymous classes to include the name of the parent class or first > interface. So instead of just class@anonymous, you'll see something like > EventHandler@anonymous in error messages, for example. > > There's a minor BC break here, for code checking for a "class@anonymous" > prefix, which should be easy to rectify by checking for "@anonymous" > instead. > > What do people think about doing this change? > > Regards, > Nikita >
Perhaps it would make sense to include the namespace used by the code which defines/instantiates the class? That might make it easier, when looking at a mysterious anonymous class using var_dump() deep in a big project perhaps, to find out where it came from. Andrea