I have a class constant
const DATE_REGEX = '@^(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$@';
which I want to use in a static array as part of a string:
public static $rules = [
'startdate' => ['required','regex:' . self::DATE_REGEX],
];
Both of those lines are part of the same class.
On my dev machine (PHP 5.6) this works fine, but on the staging server (PHP 5.4) this throws the following error:
syntax error, unexpected '.', expecting ']'
How can I rewrite this to be PHP 5.4 compatible?