As you learned, ChatGPT is not a reliable source for information like this.
On my Leap 15.5 system, I see php81 listed, and version 8.1.24 is available in the Backports update repo; you could try just installing php81 and use it that way.
Depending on your use case, it might be a better option to look into running it in a docker container.
and tried this: sudo zypper addrepo -p 90 https://download.opensuse.org/repositories/devel:languages:php/openSUSE_Leap_15.5/devel:languages:php.repo but it returned an error.
Sorry, here it is: [sudo] password for root: dynamic-pd01:/home/mamunson # sudo zypper addrepo -p 90 https://download.opensuse.org/repositories/devel:languages:php/openSUSE_Leap_15.5/devel:languages:php.repo Adding repository 'devel:languages:php (openSUSE_Leap_15.5)' ..........................................................................[error] Repository named 'devel_languages_php' already exists. Please use another alias. dynamic-pd01:/home/mamunson #
dynamic-pd01:/home/mamunson # zypper install php8-cli
Retrieving repository 'Packman' metadata ...............................................................................................[done]
Building repository 'Packman' cache ....................................................................................................[done]
Loading repository data...
Reading installed packages...
'php8-cli' is already installed.
There is an update candidate for 'php8-cli' from vendor 'obs://build.opensuse.org/devel:languages:php', while the current vendor is 'SUSE LLC <https://www.suse.com/>'. Use 'zypper install php8-cli-8.2.15-lp154.150.1.x86_64' to install this candidate.
Resolving package dependencies...
Nothing to do.
dynamic-pd01:/home/mamunson # zypper install php8-cli-8.2.15-lp154.150.1.x86_64
Loading repository data...
Reading installed packages...
Resolving package dependencies...
Problem: the to be installed php8-cli-8.2.15-lp154.150.1.x86_64 requires 'php = 8.2.15', but this requirement cannot be provided
not installable providers: php8-8.2.15-lp154.150.1.x86_64[devel_languages_php]
Solution 1: Following actions will be done:
install php8-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-bz2-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-bz2-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-ctype-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-ctype-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-curl-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-curl-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-dom-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-dom-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-fileinfo-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-fileinfo-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-gd-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-gd-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-gettext-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-gettext-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-iconv-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-iconv-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-mbstring-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-mbstring-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-mysql-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-mysql-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-openssl-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-openssl-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-pdo-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-pdo-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-phar-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-phar-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-sqlite-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-sqlite-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-tokenizer-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-tokenizer-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-xmlreader-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-xmlreader-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-xmlwriter-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-xmlwriter-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-zip-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-zip-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install php8-zlib-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing php8-zlib-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
install apache2-mod_php8-8.2.15-lp154.150.1.x86_64 from vendor obs://build.opensuse.org/devel:languages:php
replacing apache2-mod_php8-8.0.30-150400.4.37.1.x86_64 from vendor SUSE LLC <https://www.suse.com/>
Solution 2: do not install php8-cli-8.2.15-lp154.150.1.x86_64
Solution 3: break php8-cli-8.2.15-lp154.150.1.x86_64 by ignoring some of its dependencies
Choose from above solutions by number or cancel [1/2/3/c/d/?] (c):
Don’t install from devel:languages - that’s a precursor to the releases and may break things unless you know what you’re doing.
Just install from the backports repo - that should work fine. If you’re using btrfs for root (which is the default IIRC), then you can roll back if it breaks, but installing from the devel: repos is generally not recommended as I recall.
Your system should already have the backports repo installed, and if you install php81 as opposed to what you’re trying to install, it should live peacefully side-by-side with the php8 packages.
If you’re using btrfs on your root partition, you can revert to the earlier snapshot. But since you went ahead, see if it works, and if it does…consider yourself fortunate.
I guess you could also probably back it out by reinstalling what you installed with the version you removed.