Fixed PHP-813: IS_SCALAR_*() doesn't account for resources.
Merged pull request #466