Merge pull request #7263 from nupplaphil/bug/6917-php_warning