Fix bug in php defensive snippets