Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108418 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 79532 invoked from network); 6 Feb 2020 21:55:50 -0000 Received: from unknown (HELO localhost.localdomain) (76.75.200.58) by pb1.pair.com with SMTP; 6 Feb 2020 21:55:50 -0000 To: internals@lists.php.net References: Date: Thu, 6 Feb 2020 21:08:34 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 46.59.72.204 Subject: Re: Changing the generated name for anon classes From: ajf@ajf.me (Andrea Faulds) Message-ID: Hi, Nikita Popov wrote: > Hi internals, > > Based on a suggestion by Nicolas Grekas, > https://github.com/php/php-src/pull/5153 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