|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-03-27 09:16 UTC] nikic@php.net
-Status: Open
+Status: Duplicate
[2020-03-27 09:16 UTC] nikic@php.net
[2020-03-27 09:34 UTC] michael dot vorisek at email dot cz
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 02:00:01 2025 UTC |
Description: ------------ Please verify or provide an the intuition behind this behaviour. This issue is critical as CS fixers are very common these days and one of the standard rule is replace current class name with self if the name is used inside the current class definition. Test script: --------------- class TestParent { public static function className() { return static::class; } public static function classNameSelf() { return self::className(); } public static function classNameExplicit() { return TestParent::className(); } } class TestChild extends TestParent {} print(TestChild::classNameSelf()); print("\n"); print(TestChild::classNameExplicit()); Expected result: ---------------- TestParent TestParent Actual result: -------------- TestChild TestParent