hongkildong Posted November 18, 2013 Share Posted November 18, 2013 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')) Link to comment https://forums.phpfreaks.com/topic/284015-cant-get-why-php-unable-to-parse-this-code/ Share on other sites More sharing options...
Barand Posted November 18, 2013 Share Posted November 18, 2013 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 Link to comment https://forums.phpfreaks.com/topic/284015-cant-get-why-php-unable-to-parse-this-code/#findComment-1458770 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.