Why doesn't the following work in PHP?
const DAYS = 60*24*3;
I get the following error.
Parse error: syntax error, unexpected T_CONST on line 1
I'm also not able to assign an expression to the value of a property array. Note, I'm only using constant values (not calling functions or anything like that).
class A
{
public $value = array('days'=>60*24*3);
}
The above doesn't work.
$value = array('days'=>60*24*3);
But that works fine if it's assigned to a local variable!
How do you use math expressions when assigning values?