Minor PHP syntax fixes from ExolonDX

These were committed to main since RELENG_2_1 was branched. It seems useful to also apply any genuine fixes/syntax enhancements to RELENG_2_1 also, that way 2.1 has the most correct code it can.
In principle, fixes in main that do not change the displayed UI or add functionality should also be back-ported to RELENG_2_1 so that 2.1 (and in future 2.1.n) contain all known fixes for the released functionality/UI of 2.1