|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-05-09 09:18 UTC] nikic@php.net
-Assigned To:
+Assigned To: nikic
[2019-05-24 11:00 UTC] nikic@php.net
-Status: Assigned
+Status: Closed
[2019-05-24 11:00 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 21:00:01 2025 UTC |
Description: ------------ If type-equality checks during inheritance fail on simple string comparison, they fall back to loaded the class entries and comparing those. This allows aliased classes to pass inheritance checks. However, if classes are early-bound, then the alias will not be available if opcache is used, as compilation is isolated. The attached test script will work without opcache and fail with opcache. Test script: --------------- // file1.php <?php class Foo {} class_alias('Foo', 'Bar'); require __DIR__ . '/file2.php'; // file2.php <?php class A { public function test(Foo $foo) {} } class B extends A { public function test(Bar $foo) {} } Expected result: ---------------- No error. Actual result: -------------- Warning: Declaration of B::test(Bar $foo) should be compatible with A::test(Foo $foo)