It seems like installing Node.js via Homebrew may have conflicted with your PHP installation. Since Homebrew manages paths and dependencies, it’s possible that the PHP libraries got misconfigured after the Node.js installation
brew reinstall icu4c
brew link icu4c --force
brew reinstall php
which php //It should point to /usr/local/bin/php. If not,to update the PATH.
source ~/.bash_profile
brew unlink php
brew link php
brew list | grep php
brew uninstall [email protected] --Example for PHP 7.4