correct some snippets for php