Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120177 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 44267 invoked from network); 2 May 2023 11:56:46 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 May 2023 11:56:46 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4E3EB180041 for ; Tue, 2 May 2023 04:56:44 -0700 (PDT) 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,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 2 May 2023 04:56:43 -0700 (PDT) Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-94eee951c70so598916066b.3 for ; Tue, 02 May 2023 04:56:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20221208.gappssmtp.com; s=20221208; t=1683028602; x=1685620602; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=eBwf7JEFzWWQpI5upkRXSZh80Hwib/Iw78ARIErTbV0=; b=3MHn7eRE17Ob6DIEMrDuemmqkmlwYqlWpnM/HZTegbe5iBUeDozFkbDA1+pM0qSaX6 bdkNoYcr57GN0LF7RM7ZRFNdNdLH2xrarLHJ6pYWKOADAt/kV1YD+HLCTZ5erVSmrzYx hrrBjc6MKTL22Bx0NFDquSOP6suV5dLyVhPSRVfeGHmQlGGucdfbBrNlFTLvIvtgLNyR s/NHOhMAxcWExKX+UfKmG9gmdlsXp1s6Ct3N0KPvYLnJEh6LrJhiWScKslnyy0z/fQau mc0VujLuFQAvdopLjcZkkO3bVpFh+J2JlYsVpEaaqPW+nHSgrxJDeizcvhzKR6h1RbKn vDiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683028602; x=1685620602; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eBwf7JEFzWWQpI5upkRXSZh80Hwib/Iw78ARIErTbV0=; b=jPq7OrOEDNTU1udV14hjqcowRzbooSrk/jsn22DNK/5AhqgTGjFac7JqSeGzzzaBRm b/ZDLKutT8/C0G5tlEMCelnTmz31QXCMjy7QyaQ5sE83rBxlVX6KdrgbSutqpWPn+iNx g6fyJb9HNSh7cT8cCtjdT2pQZ7VzCXCTSpJaDnoJNBb8Yy+TmAW8SndlNyM3MJREOfXW otoiTAYr8S0FdjPII4saLUROTSJUCgN8/Vv6Y1DJsd0HCGJgns+G7GJaztvghtlSbXNA EncMC20lk+xjU8iGk3NNlUXHVOz3kZMKu5EP10ml7wHtlzpJBnKOLQXeXMuVmu+9og7O lyzw== X-Gm-Message-State: AC+VfDyTZ0seY8Jxq8apHmGu3PtJPtWZHRNcBbzKmbUMfLg7DgeTrBjs snLqoPHBbU+3rfm1TcmPSjZL8VW8MZulpYPRnuGNHA== X-Google-Smtp-Source: ACHHUZ6jk4a9B/Y0A4AoQ3Rjr3tEHAPhPzGH7NCOo+rMCIdYluaHKoZELG8R8nCT8ACpgoO4kImE05yAREFXogiAzxs= X-Received: by 2002:a17:907:3f04:b0:94a:4d06:3de3 with SMTP id hq4-20020a1709073f0400b0094a4d063de3mr16170373ejc.72.1683028602297; Tue, 02 May 2023 04:56:42 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 2 May 2023 12:56:31 +0100 Message-ID: To: =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= Cc: PHP Internals List Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] [Discussion] Deprecate functions with overloaded signatures From: Danack@basereality.com (Dan Ackroyd) From the RFC: > > Code which invokes get_class() without parameters should be modified to > use __CLASS__ or get_class($this) instead, I don't think the first option is equivalent: class C { function printType() { echo "__CLASS__ is " . __CLASS__ . "\n"; echo "get_class is " . get_class($this) . "\n"; } } class D extends C { function printTypeInChild() { echo "__CLASS__ is " . __CLASS__ . "\n"; echo "get_class is " . get_class($this) . "\n"; } } (new D)->printType(); (new D)->printTypeInChild(); // Output is: __CLASS__ is C get_class is D __CLASS__ is D get_class is D And unless I'm missing something, the second option doesn't appear usable with static methods, which is also a problem with get_parent_class() > while code which invokes > get_parent_class() without parameters should be modified to use > get_parent_class($this) instead. What would the equivalent code get_parent_class() for static methods? e.g. class A {} class B extends A { public static function foo() { echo get_parent_class() . " \n"; } } b::foo(); cheers Dan Ack