涉及 phar 文件的自动加载优先级是什么

What is the autoloading precedence with phar files involved

我有以下设置:我有一个 PHP 项目,它使用的框架本身依赖于某个库。这个库也在 PHPUnit 的依赖树中的某处使用。由于框架中的版本是固定的(从我的角度来看),这对可以安装的 PHPUnit 的可能版本施加了限制(当作为作曲家依赖项安装时)。

如果我想使用PHPUnit的phar文件,需要捆绑依赖。我想我在某处读到过,phar 中的内部库优先于要使用的外部库,但我找不到它了。

所以:当运行 PHPUnit as phar 时,是否会优先使用捆绑依赖项? 您是否偶然从任何地方获得了该信息的来源?

这(现在)在 documentation 中解释:

With the exception of classes such as PHPUnit\Framework\TestCase that are part of PHPUnit’s public API, all units of code bundled in PHPUnit’s PHAR distribution, including all dependencies such as vendor directories, are moved to a new and distinct namespace.

PHPUnit’s PHAR distribution does not use dynamic autoloading to load the bundled units of code. Instead, all units of code bundled in the PHAR are loaded on startup.

你在这里的问题促使我将这些信息添加到刚才的文档中。谢谢!