Today in a code audit, it was pointed out, that accessing a variable element like $array['keyname']
is not an optimum way to do it and instead a constant should be defined and then used as below.
define('KEYNAME', 'keyname'); // Constant defined somewhere centrally
$array[KEYNAME]; // actual usage
My question is, is that notion correct? And this is stemming from the tool Sonarqube.