This article explains why hooks cannot be written in conditional and loop statements using arrays. But hooks are not really organized as arrays.
This part of the article explains why to write sequentially from a source point of view. In fact, the values for hooks are retrieved as a linked list, so they are ordered, so essentially the order of the hooks cannot be changed, and conditions or traversals can cause the order to change, so cannot be placed in conditions or traversals.
The following diagram illustrates the difference between hooks and hoc.