Previous section To contents

7.4 typeof

This function returns the type of an expression as a string. It does not evaluate the expression at all, which might be somewhat confusing. Example:
typeof( exit(1) )
This will return the string "void" since exit is a function that returns void. It will not execute the function exit and exit the process as you might expect.

If you want to know the type after evaluation, use sprintf("%t", expr).


Previous section To contents