- add sm_ctype_space and function_exists check to support PHP without ctype