Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108423 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 51439 invoked from network); 7 Feb 2020 15:23:17 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Feb 2020 15:23:17 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3797D18053A for ; Fri, 7 Feb 2020 05:36:09 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 7 Feb 2020 05:36:07 -0800 (PST) Received: by mail-lf1-f44.google.com with SMTP id f24so1543346lfh.3 for ; Fri, 07 Feb 2020 05:36:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MTFpuXtwGXd9QIPYVKJDmOzD2l99DsPHLALiFvoH0Co=; b=p/ULS67kkyrJCuhTacA3w8aVWjkshGpr3Q4e91OSWdCGrg+v7P6WeNx0A7Q1tePWbc 7L6jdFDvXMR+85WTLB1jTfn8VuDIiKgZIcAueJKoVp9h/DoZgowJJIs7U9Mprze6GJPY 8agPkWFdi1MhcqI+hphV58sBaEtmgItp2Ah31tas96K83lRvu+PHx3snklNqg52tOJjs ZHUsgbxaMrwng/+YJVuCQ35Tktl60WMsQ487kPx+jnzDwXS19+tcQOYKizdmjqC4mUk4 JCIAwMNO/a0OSFYdYtu8+roPOSvsY7DoQbrBfDBbPSkse/O0/r83MTvqXg1Gsq7xSHei n7fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MTFpuXtwGXd9QIPYVKJDmOzD2l99DsPHLALiFvoH0Co=; b=UqYFZ9fSCLsKzDAePG28utQ6yMoSuHoYaYVRccYomUumV25LfWHGg2kE2M0Fw/rO3N kjGc+nDCRCXl+QcclmVmvGEk08PBKOLqMSLap6TXN1ygKvtduBix4JRLfjfBTu3zvCMW 7WTlseCqnE0V9F9s+P5FUra1u7HDKUTzrPg3ZPPgvHt9jW5oomUePMVuHhMXTxduFFT8 zKEe2Xd+MXJLi0spo4T8dMxGRdnJOu3e4OdPRwVCD8cmlDOomJqDpfukMMKmrDmXn1jH yvloQIhq1epK6esGhH0K3sCFd070txaT6ZGhurZNZVkn17VyeYA3hqwI2DVbuOWaygwY 2aXg== X-Gm-Message-State: APjAAAV8jLLaLXcpNqHqMURroRVWega1zNoslVapnvVsaAGeXQBsaHKT 2uqCSMBtI3fjbyg4k/yIC/epUdMLSO4U5MDoMC8= X-Google-Smtp-Source: APXvYqwTGDrmkg+03y4Z6cfp2bbo+z6KdBvA2QQ5zG601FcGuzp1bG7ntiQqfS4ORIjis4zpnWzc+7OVC96efbV1uMQ= X-Received: by 2002:ac2:43af:: with SMTP id t15mr4688058lfl.154.1581082562381; Fri, 07 Feb 2020 05:36:02 -0800 (PST) MIME-Version: 1.0 References: <5e3c7253.1c69fb81.c5725.860bSMTPIN_ADDED_MISSING@mx.google.com> In-Reply-To: <5e3c7253.1c69fb81.c5725.860bSMTPIN_ADDED_MISSING@mx.google.com> Date: Fri, 7 Feb 2020 14:35:46 +0100 Message-ID: To: Andrea Faulds Cc: PHP internals , Nicolas Grekas Content-Type: multipart/alternative; boundary="0000000000007dcc7f059dfc78bd" Subject: Re: [PHP-DEV] Re: Changing the generated name for anon classes From: nikita.ppv@gmail.com (Nikita Popov) --0000000000007dcc7f059dfc78bd Content-Type: text/plain; charset="UTF-8" On Thu, Feb 6, 2020 at 9:08 PM Andrea Faulds wrote: > 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. > That would be a possible alternative. This is similar to what we do for closures. As we need the generated name to be reasonably concise, we can only do one or the other though. I don't know which one is more useful... Maybe Nicolas wants to chime in. Nikita --0000000000007dcc7f059dfc78bd--