Add gettype() as C function

I'm using this in a different commit (https://github.com/realityking/php-src/commit/bbd03403192b92df622ee79a8b1f6fc0afc2dfff) for nicer error messages, but it seems like this could be usefully whether that commit gets merged or not.