This fixes https://bugs.php.net/bug.php?id=60602
The convert_to_string_ex() was modifying the underlying array while creating the environment string, so I've tweaked the respective zpp argument.
Changed zpp argument for environment to 'a' instead of 'a!'
Why does ! fix this bug? Do you maybe mean /? But in any case, I'd prefer to change the string cast (copy to local zval + convert_to_string) rather than doing a full zval separation on the array here.
Using `a/!` instead of `a` to avoid regression of #64770
Added a test case
Make the test work on other machines too =S