Sign up ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.

The PHP function below is producing this error: Parse error: syntax error, unexpected '(', expecting T_STRING or T_VARIABLE or '$', on this line that contens this code:$obj = new ( );

Does anyone know what's wrong?

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;
}
share|improve this question

closed as too localized by tereško, DaveRandom, hjpotter92, tkanzakic, Spudley Apr 26 '13 at 10:35

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    

1 Answer 1

up vote 2 down vote accepted

I think

$obj = new (  );
IApplicationContextAware;

should be

$obj = new IApplicationContextAware();
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.