使用克隆直接访问 class 成员访问

Direct access class member access with clone

从 PHP 5.4 开始,我们可以使用这种语法:

$oYesterday = (new \DateTime())->modify('-1 day');

所以我们不必创建临时变量。我想知道为什么它不适用于 clone,它会导致解析错误:

$oDayBefore = (clone $oYesterday)->modify('-1 day');

PHP Parse error:  syntax error, unexpected '->' (T_OBJECT_OPERATOR)

因为在 PHP < 7 中,解析器中的所有内容本质上都是硬编码的特例,没有人费心为 (clone $var) 编写案例。 PHP 7 终于运动出真人了 AST, where such things are possible.