Because you can never quite anticipate in which environment your particular zsh will be launched in, it is good practice to reset the options at the beginning of your script with the emulate command:
emulate -LR zsh
After the emulate command, you can explicitly set the shell
options your script requires.
The emulate command also provides a bash emulation:
emulate -LR bash