The "'3" value comes from the specific structure of the override folders :

For example, if we want to override the AdminOrders view, we must use this kind of path
    [0] => C:
    [1] => Sites
    [2] => shops
    [3] => shopname
    [4] => override
    [5] => controllers
    [6] => admin
    [7] => templates
    [8] => 
    [9] => orders
    [10] => helpers
    [11] => view
    [12] => view.tpl

The array_search returns the index for "controllers" (5), we must iterate by 3 steps to be on the "blank" value (and later in the script, we add +1 to $key to obtain the "orders" value, and finally, the "AdminOrders" value for $class