Ok, so I was able to fix the problem with time by downgrading to PHP 7.4. If someone has a better solution, please share, but this is what I needed to do: Uninstall PHP 8
brew uninstall php
Install PHP 7.4
brew install php@7.4
Now, this is where it gets fun. Alfred does not support custom paths for script languages, so it won't find your PHP installation because Homebrew installs PHP 7.4 to a different folder. You need to:
Go to the Homebrew opt folder
cd /opt/homebrew/opt
Create a symlink for the PHP installation folder
ln -s ../Cellar/php/7.4.27 php
Go to the Homebrew bin folder
cd /opt/homebrew/bin
Create a symlink for the PHP binary
ln -s ../Cellar/php/7.4.27/bin/php php
Now Alfred should be able to find your PHP 7 installation and you should be able to use time.