Array dereferencing is supported only in PHP version 5.4 and above.
It is when you use bracket access directly after a function that returns an array: array_unique($array)[0]
.
Read more: PHP 5.4: New features
I would advise you to create the array with unique items before the if
clause:
$pr_unique = array_unique($pr_id);
if ($pr_id[$i] != $pr_unique[$i]) {
....
}