$arr[0]
only works if the array as numerical keys.
array_shift
removes the element from the array and it modifies the array itself.
If you are not sure what the first key is , and you do not want to remove it from the array, you could use:
$v){
$value = $v;
break;
}
or even better: