]> granicus.if.org Git - php/commitdiff
@ Added the is_null() function that will return true if a variable is of
authorSterling Hughes <sterling@php.net>
Wed, 29 Nov 2000 15:37:38 +0000 (15:37 +0000)
committerSterling Hughes <sterling@php.net>
Wed, 29 Nov 2000 15:37:38 +0000 (15:37 +0000)
@ type null. (Sterling)

ext/standard/basic_functions.c
ext/standard/basic_functions.h

index ca00d8abed4e4c5890014a7823490040b8e2c34d..dbb6e7cb5412497ddec72bcc67fad205f6534592 100644 (file)
@@ -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) 
index b164ec1ec17efca45b9aa2530a28abb00d66b919..07c9cdc49c002fa00de8b12a7bc08ddefb966ac7 100644 (file)
@@ -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);