The support policy for PHP states:
New major releases of MediaWiki must support at least one PHP version for each of the following criteria:
A PHP version that will be supported by the upstream PHP Group for the full duration of that MediaWiki major release cycle (from our planned release date until our planned end-of-life date).
Support for MW 1.35 is expected to last until September 2023. However, security support for PHP 7.4 ends 28 Nov 2022. Thus, if we want to adhere to the policy, patches for PHP8 support should be backported to 1.35. Or we can make an exception to the policy ¯\_(ツ)_/¯