-5

下面的 PHP 函数产生了这个错误: Parse error: syntax error, unexpected '(', expecting T_STRING or T_VARIABLE or '$', on this line that content this code:$obj = new ( );

有谁知道出了什么问题?

function createContextAwareObjectOfClass($className) {
    $className;
    $obj = new (  );
    IApplicationContextAware;

    if (!( $obj instanceof null )) {
        Exception;
        throw new ( '' . 'Non-context aware class "' . $className . '" passed to createContextAwareObjectOfClass' );
    }

    $obj->setAppContext( $this );
    return $obj;
}
4

1 回答 1

2

认为

$obj = new (  );
IApplicationContextAware;

应该

$obj = new IApplicationContextAware();
于 2013-01-30T01:24:39.627 回答