It seems it's broken on at least this version. So the compatibility function
in ~/.zsh/function/compatibility is used on this version too.
As the function add-zsh-hook already exists, fpath was updated to load the
compatibility functions first.
# Simulate hooks using _functions arrays for Zsh versions older then 4.3.4. At
# the moment only precmd() and preexec() are simulated.
-if [[ $ZSH_VERSION != (4.3.<4->|4.<4->*|<5->*) ]]; then
+#
+# At least 4.3.4 (not sure about later versions) has an error in add-zsh-hook
+# so the compatibility version is used there too.
+if [[ $ZSH_VERSION != (4.3.<5->|4.<4->*|<5->*) ]]; then
# Provide add-zsh-hook which was added in 4.3.4.
- fpath=($fpath ~/.zsh/functions/compatibility)
+ fpath=(~/.zsh/functions/compatibility $fpath)
# Run all functions defined in the ${precmd,preexec}_functions arrays.
function precmd() {