php: Fix global variable clobber issue

Some versions of PHP (5.3.6 on Windows at least) may corrupt `$ost` if it is
closed off as a global variable.

Fixes #917, #969