|
Posted by Umberto Salsi on 12/17/83 11:55
"amygdala" <noreply@noreply.com> wrote:
> The full array is this (part of a session class):
>
> private $config = array(
> 'sessionTable' => DB_TABLE_SESSIONS,
> 'userTable' => DB_TABLE_USERS,
> 'persistentMaxTime' => 60*60*24*30,
> 'sessionMaxInactive' => 60*30,
> 'regenerateId' => true,
> 'idRegenerationInterval' => 10,
> 'cookieName' => 'PHPSESSION',
> 'cookiePath' => '/',
> 'checkIp' => true,
> 'checkAgent' => true
> );
>
> which yields the error:
>
> Parse error, parse error, unexpected '*', expecting ')' on line 49 (which is
> the line of 'persistentMaxTime')
That's an invalid syntax: the default value of a class property must be
a static_scalar, that is a simple number, a string or an array of these
items. Other expressions are not allowed.
Here is a chunk from the EBNF syntax of PHP 5:
static_scalar = common_scalar
| T_STRING
| "+" static_scalar
| "-" static_scalar
| "array" "(" [static_array_pair_list] ")"
| static_class_constant ;
static_array_pair_list = static_array_pair { "," static_array_pair } [","] ;
static_array_pair = static_scalar ["=>" static_scalar] ;
Check the official BNF syntax Zend/zend_language_parser.y
(http://www.icosaedro.it/articoli/php-syntax-yacc.txt)
or the equivalent EBNF syntax translated by me from that file
(http://www.icosaedro.it/articoli/php-syntax-ebnf.txt)
So, expressions like "60*30" aren't allowed. Use "1800" instead.
Regards,
___
/_|_\ Umberto Salsi
\/_\/ www.icosaedro.it
Navigation:
[Reply to this message]
|