|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-01-08 16:01 UTC] nikic@php.net
-Status: Open
+Status: Wont fix
[2020-01-08 16:01 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
Description: ------------ Since a class alias is assigned during run time, I suppose it would make sense to allow a class alias's update. Use case: E.g. in a system where multiple classes of different code versions (temporarily) exist to ensure backward compatibility when importing a number of updates. The versions of the class could all be put in separate temporarily generated uniquely named namespaces. During the execution of the updates, the class alias could be updated once it reaches an update which needs to use a newer version of a class that was also used by previous updates - albeit in an older state. Might be a good idea to include this in PHP 7. It seems like a small enhancement. Test script: --------------- class A {} class B {} class_alias("A", "X"); class_alias("B", "X"); Expected result: ---------------- Class alias X becomes B's alias. Actual result: -------------- Fatal error: Cannot redeclare class A