|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-11-29 14:56 UTC] requinix@php.net
-Status: Open
+Status: Feedback
[2019-11-29 14:56 UTC] requinix@php.net
[2019-11-29 22:43 UTC] nikic@php.net
[2019-12-08 04:22 UTC] php-bugs at lists dot php dot net
[2019-12-08 07:46 UTC] nikic@php.net
-Summary: Changed order in get_declared_classes() with
parent(s) loaded by autoloader
+Summary: Side-effects for uninitialised typed property
-Status: No Feedback
+Status: Re-Opened
[2019-12-08 07:46 UTC] nikic@php.net
[2019-12-09 07:58 UTC] nikic@php.net
[2019-12-09 07:58 UTC] nikic@php.net
-Status: Re-Opened
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 16 10:00:01 2025 UTC |
Description: ------------ After loading a class which inherits from other classes and parent classes are loaded by autoloader, get_declared_classes() gives another order than in previous PHP versions. < 7.4: parent => child 7.4: child => parent Result of code example (reverse order of get_declared_classes()): Array ( [0] => A [1] => B ... ) vs. Array ( [0] => B [1] => A ... ) Url: https://3v4l.org/lEnsR Test script: --------------- <?php spl_autoload_register(function($class){ if ($class === 'A') { eval("class A { }"); } }); class B extends A { } print_r(array_reverse(get_declared_classes())); Expected result: ---------------- Parent class(es) should be declared before child class. Actual result: -------------- Parent classes are declared before child class.