此函数调用的操作顺序是什么


What is the order of operations with this function call?

<?php
class MyClass
{
    static function test()
    {
        echo "Victor";
    }
    static function result()
    {
        echo "My name is ".self::test();
    }
}
MyClass::result();
?>

我很困惑为什么self::test()在命令的其余部分之前执行,或者相反。提前感谢您的评论。

因为要获得需要回显的字符串需要"准备"。 所以在输出之前,它需要知道它的返回值是什么。 它首先执行,它的结果包含在字符串中。实际上,self::test(); 不返回值,而是回显出一些文本。