I define a constant with:
const NAMES = [
'boys' => 'john',
'girls' => 'sue',
];
I try and then call the constant later with:
NAMES['boys']
But get the error:
"Use of undefined constant NAMES - assumed 'NAMES'"
Why is this happening?
EDIT:
It's on a class with PHP7