...

View Full Version : Problem with passing time() as argument in constructor



earni23
03-02-2010, 10:57 AM
Why doesn´t the following code work:

public function __construct($time = time())
{
}

...unexpected '('..expecting ')'

abduraooft
03-02-2010, 11:18 AM
See the manual http://php.net/manual/en/functions.arguments.php

The default value must be a constant expression, not (for example) a variable, a class member or a function call.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum