php実行時にlibicuio.73.dylibphpの参照エラー

先日、開発環境を立ち上げる際にphp実行時エラーに遭遇しました。

% php -v
dyld[84774]: Library not loaded: @loader_path/../../../../opt/icu4c/lib/libicuio.73.dylib
Referenced from: <90055B36-6315-3FD7-9F54-5F9D08D9F325> /opt/homebrew/Cellar/php@8.0/8.0.30/bin/php
Reason: tried: '/opt/homebrew/Cellar/php@8.0/8.0.30/bin/../../../../opt/icu4c/lib/libicuio.73.dylib' (no such file), '/usr/local/lib/libicuio.73.dylib' (no such file), '/usr/lib/libicuio.73.dylib' (no such file, not in dyld cache)
zsh: abort php -v

brew info で調べてみるとicu4cの74が入っていたようなので、Qiitaや他のテックサイトを参考に、gitからicu4cの73をbrew tapしてインストールする方法を試していたのですが、gitリポジトリでgit clone する際にicu4cのログがgit logで見つからず(おそらくパスが間違っていたのだと思うのですが)、最終的に下記の方法でlibicu4cの7.3をインストールしました。

wget https://raw.githubusercontent.com/Homebrew/homebrew-core/6aca0f221ee4ac0c25735dbf31cc01fed984d8f6/Formula/icu4c.rb
brew reinstall --formula icu4c.rb

最終的にはphp8.0をバージョンアップすることで恒久対応を行ったのですが、取り急ぎphp8.0を使わなくてはいけない方でlibicu4cがバージョンアップされてしまって困っている方がいたら上記の方法で解決できる可能性があります。