`$dir = array_shift($possibleApps);`
Instead of reset+current