I was looking how to improve some verbose PHP interop syntax today and came up with an ingenious Emacs font-lock setting for beginnings of symbols starting with php/ in the meanwhile.
That's a whole parade of them!
Unless php/ is used extensively in all kinds of contexts, for the particular case of getting globals I'd probably just create a get-in-globals fn that could be called like (get-in-globals ["_SERVER" "PHP_SELF"]).
Indeed!
Had similar idea sent as issue https://github.com/phel-lang/phel-lang/issues/939
Recently attribute/method access via php/-> was improved to accept nested calls also which is quite similar.
Special threading form might help also.
This imaginary PHP-> has different meaning from built-in php/-> which indicates object->method() style access. It would slam php/ in front of every relevant symbol's name, but would need to avoid messing other symbols.
(PHP-> $GLOBALS
(aget "_SERVER")
(aget "PHP_SELF"))
(PHP-> $GLOBALS
(aget-in ["_SERVER" "PHP_SELF"]))
aget-in got added https://github.com/phel-lang/phel-lang/pull/944
goes like hot knife through butter