在 PHP 5.0.4+ 中,这可以正常工作:$instance = new $foo->bar($arg);完整示例:<?php$foo = new foo();$arg = 'hello';$class = $foo->bar;$instance = new $class($arg);$instance = new $foo->bar($arg); // your requested shorthandclass foo { public $bar = 'bar';}class bar { public function __construct($arg) { echo $arg; }}