Various improvements to PHP snippets