In reply to ashish_banga:
If you change your associative array index from a wildcard ‘*’ to any explicit data type like ‘int’, you can use a single foreach loop:
int egress_port_pid_pri[3][int][int][$];
foreach (egress_port_pid_pr[i,j,k]) if (egress_port_pid_pr[i][j][k].size() == 0) ...
I recommend avoiding the wildcard index type altogether and always use an explicit datatype.