而且,输出仍然一样。
改变 Virtual Type 的行为:
You’ll notice that the property_of_argument1_object property is now an Argument3 object — but only when that parameter’s owner class (Argument1) is instantiated by dependency injection in the Example class. When we instantiate Argument1 by itself — Magento does not inject a dependency.
这样子的配置,只有当参数的拥有类Argument1,被注入到Example中,才会生效。实例化本身并不会。