From: Sterling Hughes Date: Wed, 29 Nov 2000 15:37:38 +0000 (+0000) Subject: @ Added the is_null() function that will return true if a variable is of X-Git-Tag: php-4.0.4RC3~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2cc8e2f8c79b4ca00c2e4ef953c12ea1ef6588d4;p=php @ Added the is_null() function that will return true if a variable is of @ type null. (Sterling) --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index ca00d8abed..dbb6e7cb54 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -309,6 +309,7 @@ function_entry basic_functions[] = { PHP_FE(get_magic_quotes_gpc, NULL) PHP_FE(get_magic_quotes_runtime, NULL) + PHP_FE(is_null, first_arg_allow_ref) PHP_FE(is_resource, first_arg_allow_ref) PHP_FE(is_bool, first_arg_allow_ref) PHP_FE(is_long, first_arg_allow_ref) @@ -1306,6 +1307,14 @@ void php_is_type(INTERNAL_FUNCTION_PARAMETERS,int type) } } +/* {{{ proto bool is_null(mixed var) + Returns true if variable is null */ +PHP_FUNCTION(is_null) +{ + php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_NULL); +} +/* }}} */ + /* {{{ proto bool is_resource(mixed var) Returns true if variable is a resource */ PHP_FUNCTION(is_resource) diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h index b164ec1ec1..07c9cdc49c 100644 --- a/ext/standard/basic_functions.h +++ b/ext/standard/basic_functions.h @@ -67,6 +67,7 @@ PHP_FUNCTION(get_magic_quotes_runtime); PHP_FUNCTION(get_magic_quotes_gpc); void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type); +PHP_FUNCTION(is_null); PHP_FUNCTION(is_resource); PHP_FUNCTION(is_bool); PHP_FUNCTION(is_long);