-5

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;
}
1

1 Answer 1

2

I think

$obj = new (  );
IApplicationContextAware;

should be

$obj = new IApplicationContextAware();
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.