Jump to content

Can't get why php unable to parse this code


hongkildong

Recommended Posts

class QuestionTagTable extends Doctrine_Table
{
    public function getRelatedTags(array $tags, $limit = sfConfig::get('app_tags_on_sidebar'))
    {
   
    }
}

PHP reports Parse error: syntax error, unexpected '(', expecting ')' on line 

public function getRelatedTags(array $tags, $limit = sfConfig::get('app_tags_on_sidebar'))

Check out default arguments in the manual

 

 

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

 

http://www.php.net/manual/en/functions.arguments.php#functions.arguments.default

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.