Saturday, June 16, 2018

parsing - php unexpected ')' parse error

$expires = time()+604800


in the function definition.




Default value can't be the result of a function, only a simple value
QUoting from the manual:




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




Use:




public function set($name,$value,$expires = NULL) { 
if (is_null($expires))
$expires = time()+604800;
echo $expires;
return setcookie($name, $value, $expires);
}

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...