Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108413 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 25792 invoked from network); 6 Feb 2020 15:32:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Feb 2020 15:32:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CA49C180210 for ; Thu, 6 Feb 2020 05:45:11 -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=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS20857 77.72.144.0/21 X-Spam-Virus: No X-Envelope-From: Received: from 2-smtp.kingsquare.nl (2-smtp.kingsquare.nl [77.72.144.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 6 Feb 2020 05:45:10 -0800 (PST) Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) by 2-smtp.kingsquare.nl (Postfix) with ESMTPSA id 1D41D202DE for ; Thu, 6 Feb 2020 13:45:09 +0000 (UTC) Received: by mail-oi1-f171.google.com with SMTP id i1so4588332oie.8 for ; Thu, 06 Feb 2020 05:45:09 -0800 (PST) X-Gm-Message-State: APjAAAXH4GuDjS+saeT3eQydjNlWbhBcXOlWBCMJxCpT/giMIpjQnB2d ysDwQudiI6OnNC662f9dOM1M3DjuhJJFKOKu9fE= X-Google-Smtp-Source: APXvYqz49rS+KGncHcqxOvqkRpxcSUwk1YfZ0QBl+6r0V1Ywo4IoPTg5sffNWUEZDkVi5XxRRqx+6fb1kd4LAUwnAcU= X-Received: by 2002:a54:4816:: with SMTP id j22mr6898972oij.179.1580996708096; Thu, 06 Feb 2020 05:45:08 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 6 Feb 2020 14:44:57 +0100 X-Gmail-Original-Message-ID: Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000002d63cc059de87b1c" Subject: Re: [PHP-DEV] Changing the generated name for anon classes From: robin@kingsquare.nl ("Kingsquare.nl - Robin Speekenbrink") --0000000000002d63cc059de87b1c Content-Type: text/plain; charset="UTF-8" Nikita, Just to chime in here: would it be wise to add an interface instead? (this would automatically be added by the engine) so that the consumer of a generated class could *really* know based on the interface that it's a generated anonymous class instead of string type checking the classname? Relying on some interface seems te be more future proof than just changing the string to look up ;) Keep up the good work! Regards Robin Op do 6 feb. 2020 om 12:21 schreef Nikita Popov : > 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 > --0000000000002d63cc059de87b1c--