]> granicus.if.org Git - php/commitdiff
Special-case aliases, add warning comments to implementations
authorAndrea Faulds <ajf@ajf.me>
Thu, 28 Aug 2014 19:53:32 +0000 (20:53 +0100)
committerNikita Popov <nikic@php.net>
Thu, 28 Aug 2014 22:10:52 +0000 (00:10 +0200)
Zend/zend_builtin_functions.c
Zend/zend_compile.c
ext/standard/basic_functions.c
ext/standard/type.c

index 123e42f84c7730e3ff9668fe10d06a9dd0621bac..4a0a71fd047748f1c4d97f9fdadd5f66a49d61a2 100644 (file)
@@ -519,7 +519,8 @@ ZEND_FUNCTION(func_get_args)
 /* }}} */
 
 /* {{{ proto int strlen(string str)
-   Get string length */
+   Get string length
+   Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
 ZEND_FUNCTION(strlen)
 {
        zend_string *s;
@@ -776,7 +777,8 @@ repeat:
 
 
 /* {{{ proto bool defined(string constant_name)
-   Check whether a constant exists */
+   Check whether a constant exists
+   Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
 ZEND_FUNCTION(defined)
 {
        zend_string *name;
index 961ab4897c9f7c15ed93d33208029631301bb923..aa3ac722e1e7fc2329156eede5576cb44c26a13c 100644 (file)
@@ -4274,9 +4274,15 @@ int zend_try_compile_special_func(
                return zend_compile_func_typecheck(result, args, IS_NULL TSRMLS_CC);
        } else if (zend_string_equals_literal(lcname, "is_bool")) {
                return zend_compile_func_typecheck(result, args, _IS_BOOL TSRMLS_CC);
-       } else if (zend_string_equals_literal(lcname, "is_long")) {
+       } else if (zend_string_equals_literal(lcname, "is_long")
+               || zend_string_equals_literal(lcname, "is_int")
+               || zend_string_equals_literal(lcname, "is_integer")
+       ) {
                return zend_compile_func_typecheck(result, args, IS_LONG TSRMLS_CC);
-       } else if (zend_string_equals_literal(lcname, "is_float")) {
+       } else if (zend_string_equals_literal(lcname, "is_float")
+               || zend_string_equals_literal(lcname, "is_double")
+               || zend_string_equals_literal(lcname, "is_real")
+       ) {
                return zend_compile_func_typecheck(result, args, IS_DOUBLE TSRMLS_CC);
        } else if (zend_string_equals_literal(lcname, "is_string")) {
                return zend_compile_func_typecheck(result, args, IS_STRING TSRMLS_CC);
index 39dba42fc76bf7816056b8f104e90cf4279c9c0e..31012d2c2a43a220018ff1ad0009dcf3aa21d366 100644 (file)
@@ -4714,7 +4714,8 @@ PHP_FUNCTION(error_get_last)
 /* }}} */
 
 /* {{{ proto mixed call_user_func(mixed function_name [, mixed parmeter] [, mixed ...])
-   Call a user function which is the first parameter */
+   Call a user function which is the first parameter
+   Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
 PHP_FUNCTION(call_user_func)
 {
        zval retval;
@@ -4741,7 +4742,8 @@ PHP_FUNCTION(call_user_func)
 /* }}} */
 
 /* {{{ proto mixed call_user_func_array(string function_name, array parameters)
-   Call a user function which is the first parameter with the arguments contained in array */
+   Call a user function which is the first parameter with the arguments contained in array
+   Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
 PHP_FUNCTION(call_user_func_array)
 {
        zval *params, retval;
index 7f18a21c7a1d973c2e01f2d74f872ba78257c306..b320d9e5c5c758e3e37d1088b487bef799136932 100644 (file)
@@ -243,7 +243,8 @@ static inline void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type)
 
 
 /* {{{ proto bool is_null(mixed var)
-   Returns true if variable is null */
+   Returns true if variable is null
+   Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
 PHP_FUNCTION(is_null)
 {
        php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_NULL);
@@ -251,7 +252,8 @@ PHP_FUNCTION(is_null)
 /* }}} */
 
 /* {{{ proto bool is_resource(mixed var)
-   Returns true if variable is a resource */
+   Returns true if variable is a resource
+   Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
 PHP_FUNCTION(is_resource)
 {
        php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_RESOURCE);
@@ -259,7 +261,8 @@ PHP_FUNCTION(is_resource)
 /* }}} */
 
 /* {{{ proto bool is_bool(mixed var)
-   Returns true if variable is a boolean */
+   Returns true if variable is a boolean
+   Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
 PHP_FUNCTION(is_bool)
 {
        zval *arg;
@@ -274,7 +277,8 @@ PHP_FUNCTION(is_bool)
 /* }}} */
 
 /* {{{ proto bool is_long(mixed var)
-   Returns true if variable is a long (integer) */
+   Returns true if variable is a long (integer)
+   Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
 PHP_FUNCTION(is_long)
 {
        php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_LONG);
@@ -282,7 +286,8 @@ PHP_FUNCTION(is_long)
 /* }}} */
 
 /* {{{ proto bool is_float(mixed var)
-   Returns true if variable is float point*/
+   Returns true if variable is float point
+   Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
 PHP_FUNCTION(is_float)
 {
        php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_DOUBLE);
@@ -290,7 +295,8 @@ PHP_FUNCTION(is_float)
 /* }}} */
 
 /* {{{ proto bool is_string(mixed var)
-   Returns true if variable is a string */
+   Returns true if variable is a string
+   Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
 PHP_FUNCTION(is_string)
 {
        php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_STRING);
@@ -298,7 +304,8 @@ PHP_FUNCTION(is_string)
 /* }}} */
 
 /* {{{ proto bool is_array(mixed var)
-   Returns true if variable is an array */
+   Returns true if variable is an array
+   Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
 PHP_FUNCTION(is_array)
 {
        php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_ARRAY);
@@ -306,7 +313,8 @@ PHP_FUNCTION(is_array)
 /* }}} */
 
 /* {{{ proto bool is_object(mixed var)
-   Returns true if variable is an object */
+   Returns true if variable is an object
+   Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
 PHP_FUNCTION(is_object)
 {
        php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_OBJECT);