In trying the next PHP 7.2 release out on my site (previously we've been on 7.1 with no problems) I noticed that one of our older scripts suddenly began throwing up this warning.
Warning: Use of undefined constant priority - assumed 'priority' (this will throw an Error in a future version of PHP) in /../plugins.inc.php on line 146
Of course I could hide this as it's only a warning but I'd rather figure out the problem than store them up for PHP8.0. The code it relates to is this block and nothing else in the file appears to be related to it.
function SortByActionPriority($a, $b) {
return $a[priority] > $b[priority] ? 1 : -1;
}
Sadly this is not a system I'm familiar with (it's an older one) and it has thousands of PHP files, so I'm not entirely sure where else in the program this is being used for full context.