Hmm... Seems to work even for the more obscure cases:
typeof(class{});
(4) Result: function( : object(is HilfeInput()->__class_65709_0_line_1))
typeof(Stdio.Stat());
(5) Result: object(is _static_modules.files()->Stat)
Note that it will fall back to the old syntax if it fails to look up the program id:
_typeof(compile_string(""));
(6) Result: function( : object(is 65723))
mixed x = compile_string(""); _typeof(x);
(7) Result: function( : object(is -))
pike-devel@lists.lysator.liu.se