The CONFLICTS definition of the lang/php?? ports prevents building a new version on the base system (i.e. outside poudriere).
It contains an explicit list of conflicting packages, which has to be maintained - but a wildcard pattern would work as well.
And it does not cover the ports that include lang/php??/Makefile via ${MASTERDIR}/Makefile and which in general do not have any CONFLICTS definitions (but instead rely on the lang/php?? dependency conflicting between versions).
The suggested patch allows the various lang/php?? ports to be built even though a different version is installed. This has been tested to work with a few combinations of installed and newly built version, and the build and all tests succeeded.
The wildcard pattern will work for all ports that have a 2 digit number as part of the php version prefix (i.e. 80 as in php80).
It does extend into other ports that include this Makefile. They have ${PKGNAMESUFFIX} set and thus will correctly and early conflict with different installed versions of the same port (and not only report that the required interpreter could not be built).
The lang/php73 port is not covered by the patch since it is EoL and will have been deleted when this patch is scheduled to be applied.
This patch does not affect package building with Poudriere (i.e. on the official package builders).
It is only relevant for port building on the base system with other PHP ports already installed and visible during the build.