]> granicus.if.org Git - php/commitdiff
Zend compatibility patch
authorZeev Suraski <zeev@php.net>
Mon, 30 Jul 2001 05:36:18 +0000 (05:36 +0000)
committerZeev Suraski <zeev@php.net>
Mon, 30 Jul 2001 05:36:18 +0000 (05:36 +0000)
ext/ereg/ereg.c
ext/mbstring/mbstring.c
ext/ovrimos/ovrimos.c
ext/pcntl/pcntl.c
ext/pcre/php_pcre.c
ext/standard/basic_functions.c
ext/standard/dns.c
ext/standard/exec.c
ext/standard/image.c
ext/standard/reg.c
ext/yaz/php_yaz.c

index 7116dad68ae38d418c9aa4260b113dc3e51d03f0..63344b8878c35f879bee27fd6600271f07913495 100644 (file)
@@ -194,10 +194,6 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
                if (zend_get_parameters_ex(3, &regex, &findin, &array) == FAILURE) {
                        WRONG_PARAM_COUNT;
                }
-               if (!ParameterPassedByReference(ht, 3)) {
-                       php_error(E_WARNING, "Array to be filled with values must be passed by reference.");
-                       RETURN_FALSE;
-               }
                break;
        default:
                WRONG_PARAM_COUNT;
index 845350a76f0fbdaccbdcdefb961c147295917be2..7dd1cb796238434ee70050a431eff263682c48fc 100644 (file)
@@ -2321,11 +2321,6 @@ detect_end:
                        n = 2;
                        while (n < argc || stack_level > 0) {
                                if (stack_level <= 0) {
-                                       if (!ParameterPassedByReference(ht, n + 1)) {
-                                               n++;
-                                               php_error(E_WARNING, "argument %d not passed by reference", n);
-                                               continue;
-                                       }
                                        var = args[n++];
                                        if (Z_TYPE_PP(var) == IS_ARRAY || Z_TYPE_PP(var) == IS_OBJECT) {
                                                target_hash = HASH_OF(*var);
index 63f88610072cde2c015658b65db393250865ec53..6aeb07a002473172c84aa5916f0353a0a7ada7bc 100644 (file)
@@ -699,12 +699,6 @@ PHP_FUNCTION(ovrimos_fetch_into)
                }
        }
 
-       if (!ParameterPassedByReference(ht, 2)) {       /* 1-based?... */
-               php_error(E_WARNING,
-                         "Array not passed by reference in call to ovrimos_fetch_into()");
-               RETURN_FALSE;
-       }
-
        if (arr->type != IS_ARRAY) {
                if (array_init(arr) == FAILURE) {
                        php_error(E_WARNING,
@@ -1287,7 +1281,7 @@ function_entry ovrimos_functions[] = {
            PHP_FE(ovrimos_prepare, NULL)
            PHP_FE(ovrimos_execute, NULL)
            PHP_FE(ovrimos_fetch_row, NULL)
-           PHP_FE(ovrimos_fetch_into, NULL)
+           PHP_FE(ovrimos_fetch_into, second_arg_force_ref)
            PHP_FE(ovrimos_field_len, NULL)
            PHP_FE(ovrimos_field_name, NULL)
            PHP_FE(ovrimos_field_type, NULL)
index 47da23fa289e954123ad51cf7320718e92b32bfa..cba769d12a1bdd5e22580987e4a8e027eca90bbd 100755 (executable)
@@ -40,7 +40,7 @@ static int pcntl_zend_extension_active;
 
 function_entry pcntl_functions[] = {
        PHP_FE(pcntl_fork,      NULL)   
-       PHP_FE(pcntl_waitpid,   NULL)   
+       PHP_FE(pcntl_waitpid,   second_arg_force_ref)   
        PHP_FE(pcntl_signal,    NULL)
        PHP_FE(pcntl_wifexited, NULL)
        PHP_FE(pcntl_wifstopped, NULL)
@@ -212,13 +212,7 @@ PHP_FUNCTION(pcntl_waitpid)
        }
 
        convert_to_long_ex(pid);
-       convert_to_long_ex(options);
-   
-       if (!ParameterPassedByReference(ht, 2)) {
-               php_error(E_WARNING, "Status not passed by reference in %s", get_active_function_name());
-               RETURN_FALSE;
-       }
-   
+       convert_to_long_ex(options);   
        convert_to_long_ex(status);
 
         if (ZEND_NUM_ARGS()==2) temp_options=0;
index 8d7dcb7ba2dabdbd16c22743ae888631cbe25b5e..50230cbd03acb723fc8399ea4371075cd872660e 100644 (file)
@@ -366,20 +366,12 @@ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global)
                        }
                        if (global)
                                subpats_order_val = PREG_PATTERN_ORDER;
-                       if (!ParameterPassedByReference(ht, 3)) {
-                               zend_error(E_WARNING, "Array to be filled with matches must be passed by reference.");
-                               RETURN_FALSE;
-                       }
                        break;
 
                case 4:
                        if (zend_get_parameters_ex(4, &regex, &subject, &subpats, &subpats_order) == FAILURE) {
                                WRONG_PARAM_COUNT;
                        }
-                       if (!ParameterPassedByReference(ht, 3)) {
-                               zend_error(E_WARNING, "Array to be filled with matches must be passed by reference.");
-                               RETURN_FALSE;
-                       }
        
                        /* Make sure subpats_order is a number */
                        convert_to_long_ex(subpats_order);
@@ -1378,8 +1370,6 @@ PHP_FUNCTION(preg_grep)
 
 /* {{{ module definition structures */
 
-unsigned char third_arg_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE };
-
 function_entry pcre_functions[] = {
        PHP_FE(preg_match,                              third_arg_force_ref)
        PHP_FE(preg_match_all,                  third_arg_force_ref)
index 7767ec275d063e7a4c29dcc1a6cb245d8fc6251a..79ba88974be64170e8628329f1a85d7dda1992c9 100644 (file)
@@ -72,7 +72,6 @@ php_basic_globals basic_globals;
 
 static unsigned char second_and_third_args_force_ref[] = { 3, BYREF_NONE, BYREF_FORCE, BYREF_FORCE };
 static unsigned char second_args_force_ref[] = { 2, BYREF_NONE, BYREF_FORCE };
-static unsigned char third_argument_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE };
 static unsigned char third_and_fourth_args_force_ref[] = { 4, BYREF_NONE, BYREF_NONE, BYREF_FORCE, BYREF_FORCE };
 static unsigned char third_and_rest_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE_REST };
 
@@ -188,7 +187,7 @@ function_entry basic_functions[] = {
        PHP_FE(trim,                                                                    NULL)
        PHP_FE(ltrim,                                                                   NULL)
        PHP_FE(strip_tags,                                                              NULL)
-       PHP_FE(similar_text,                                                    third_argument_force_ref)
+       PHP_FE(similar_text,                                                    third_arg_force_ref)
        PHP_FE(explode,                                                                 NULL)
        PHP_FE(implode,                                                                 NULL)
        PHP_FE(setlocale,                                                               NULL)
@@ -335,21 +334,21 @@ 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)
-       PHP_FALIAS(is_int,                      is_long,                        first_arg_allow_ref)
-       PHP_FALIAS(is_integer,          is_long,                        first_arg_allow_ref)
-       PHP_FALIAS(is_float,            is_double,                      first_arg_allow_ref)
-       PHP_FE(is_double,                                                               first_arg_allow_ref)
-       PHP_FALIAS(is_real,                     is_double,                      first_arg_allow_ref)
+       PHP_FE(is_null,                                 NULL)
+       PHP_FE(is_resource,                                                             NULL)
+       PHP_FE(is_bool,                                                                 NULL)
+       PHP_FE(is_long,                                                                 NULL)
+       PHP_FALIAS(is_int,                      is_long,                        NULL)
+       PHP_FALIAS(is_integer,          is_long,                        NULL)
+       PHP_FALIAS(is_float,            is_double,                      NULL)
+       PHP_FE(is_double,                                                               NULL)
+       PHP_FALIAS(is_real,                     is_double,                      NULL)
        PHP_FE(is_numeric,                                                              NULL)
-       PHP_FE(is_string,                                                               first_arg_allow_ref)
-       PHP_FE(is_array,                                                                first_arg_allow_ref)
-       PHP_FE(is_object,                                                               first_arg_allow_ref)
+       PHP_FE(is_string,                                                               NULL)
+       PHP_FE(is_array,                                                                NULL)
+       PHP_FE(is_object,                                                               NULL)
     PHP_FE(is_scalar,                               NULL)
-       PHP_FE(is_callable,                                                             third_argument_force_ref)
+       PHP_FE(is_callable,                                                             third_arg_force_ref)
 
        PHP_FE(error_log,                                                               NULL)
        PHP_FE(call_user_func,                                                  NULL)
@@ -358,8 +357,8 @@ function_entry basic_functions[] = {
        PHP_FE(call_user_method_array,                  second_arg_force_ref)
 
        PHP_FE(var_dump,                                                                NULL)
-       PHP_FE(serialize,                                                               first_arg_allow_ref)
-       PHP_FE(unserialize,                                                             first_arg_allow_ref)
+       PHP_FE(serialize,                                                               NULL)
+       PHP_FE(unserialize,                                                             NULL)
 
        PHP_FE(register_shutdown_function,      NULL)
 
@@ -391,9 +390,9 @@ function_entry basic_functions[] = {
        PHP_FE(move_uploaded_file,                      NULL)
 
        /* functions from reg.c */
-       PHP_FE(ereg,                                                                    third_argument_force_ref)
+       PHP_FE(ereg,                                                                    third_arg_force_ref)
        PHP_FE(ereg_replace,                                                    NULL)
-       PHP_FE(eregi,                                                                   third_argument_force_ref)
+       PHP_FE(eregi,                                                                   third_arg_force_ref)
        PHP_FE(eregi_replace,                                                   NULL)
        PHP_FE(split,                                                                   NULL)
        PHP_FE(spliti,                                                                  NULL)
@@ -563,7 +562,7 @@ function_entry basic_functions[] = {
        PHP_FE(uksort,                                                                  first_arg_force_ref)
        PHP_FE(shuffle,                                                                 first_arg_force_ref)
        PHP_FE(array_walk,                                                              first_arg_force_ref)
-       PHP_FE(count,                                                                   first_arg_allow_ref)
+       PHP_FE(count,                                                                   NULL)
        PHP_FE(end,                                                                     first_arg_force_ref)
        PHP_FE(prev,                                                                    first_arg_force_ref)
        PHP_FE(next,                                                                    first_arg_force_ref)
@@ -604,7 +603,7 @@ function_entry basic_functions[] = {
 
        /* aliases from array.c */
        PHP_FALIAS(pos,                         current,                        first_arg_force_ref)
-       PHP_FALIAS(sizeof,                      count,                          first_arg_allow_ref)
+       PHP_FALIAS(sizeof,                      count,                          NULL)
 
        /* functions from assert.c */
        PHP_FE(assert,          NULL)
index bf8fa2eb76be3c4781a30eb6e5107f96f8921f65..f3a4d71b8d5a5d0f03e7fb15e7d33cd37d14bbe0 100644 (file)
@@ -256,19 +256,11 @@ PHP_FUNCTION(getmxrr)
                if (zend_get_parameters(ht, 2, &host, &mx_list) == FAILURE) {
                        WRONG_PARAM_COUNT;
                }
-               if (!ParameterPassedByReference(ht, 2)) {
-                       php_error(E_WARNING, "Array to be filled with values must be passed by reference.");
-                       RETURN_FALSE;
-               }
         break;
     case 3:
                if (zend_get_parameters(ht, 3, &host, &mx_list, &weight_list) == FAILURE) {
                        WRONG_PARAM_COUNT;
                }
-               if (!ParameterPassedByReference(ht, 2) || !ParameterPassedByReference(ht, 3)) {
-                       php_error(E_WARNING, "Array to be filled with values must be passed by reference.");
-                       RETURN_FALSE;
-               }
         need_weight = 1;
                pval_destructor(weight_list); /* start with clean array */
                if ( array_init(weight_list) == FAILURE ) {
index 7d538a4335bdb7adccafc6a97962abca0b23cf36..a6693418901b1a9c7eeda8b50add96675413f21d 100644 (file)
@@ -251,18 +251,9 @@ PHP_FUNCTION(exec)
                        ret = php_Exec(0, Z_STRVAL_PP(arg1), NULL,return_value);
                        break;
                case 2:
-                       if (!ParameterPassedByReference(ht,2)) {
-                               php_error(E_WARNING,"Array argument to exec() not passed by reference");
-                       }
                        ret = php_Exec(2, Z_STRVAL_PP(arg1),*arg2,return_value);
                        break;
                case 3:
-                       if (!ParameterPassedByReference(ht,2)) {
-                               php_error(E_WARNING,"Array argument to exec() not passed by reference");
-                       }
-                       if (!ParameterPassedByReference(ht,3)) {
-                               php_error(E_WARNING,"return_status argument to exec() not passed by reference");
-                       }
                        ret = php_Exec(2,Z_STRVAL_PP(arg1),*arg2,return_value);
                        Z_TYPE_PP(arg3) = IS_LONG;
                        Z_LVAL_PP(arg3)=ret;
@@ -288,9 +279,6 @@ PHP_FUNCTION(system)
                        ret = php_Exec(1, Z_STRVAL_PP(arg1), NULL,return_value);
                        break;
                case 2:
-                       if (!ParameterPassedByReference(ht,2)) {
-                               php_error(E_WARNING,"return_status argument to system() not passed by reference");
-                       }
                        ret = php_Exec(1, Z_STRVAL_PP(arg1), NULL,return_value);
                        Z_TYPE_PP(arg2) = IS_LONG;
                        Z_LVAL_PP(arg2)=ret;
@@ -315,9 +303,6 @@ PHP_FUNCTION(passthru)
                        ret = php_Exec(3, Z_STRVAL_PP(arg1), NULL,return_value);
                        break;
                case 2:
-                       if (!ParameterPassedByReference(ht,2)) {
-                               php_error(E_WARNING,"return_status argument to system() not passed by reference");
-                       }
                        ret = php_Exec(3, Z_STRVAL_PP(arg1), NULL,return_value);
                        Z_TYPE_PP(arg2) = IS_LONG;
                        Z_LVAL_PP(arg2)=ret;
index 7b550f9519ee1ce6a95a392589d9215d07c0299f..6294cd60b29466160f8c803b7763d93f0a707731 100644 (file)
@@ -422,11 +422,6 @@ PHP_FUNCTION(getimagesize)
                if (zend_get_parameters_ex(2, &arg1, &info) == FAILURE) {
                        WRONG_PARAM_COUNT;
                }
-               if (!ParameterPassedByReference(ht, 2)) {
-                       php_error(E_WARNING, "Array to be filled with values must be passed by reference.");
-                       RETURN_FALSE;
-               }
-
                zval_dtor(*info);
 
                if (array_init(*info) == FAILURE) {
index 7116dad68ae38d418c9aa4260b113dc3e51d03f0..63344b8878c35f879bee27fd6600271f07913495 100644 (file)
@@ -194,10 +194,6 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
                if (zend_get_parameters_ex(3, &regex, &findin, &array) == FAILURE) {
                        WRONG_PARAM_COUNT;
                }
-               if (!ParameterPassedByReference(ht, 3)) {
-                       php_error(E_WARNING, "Array to be filled with values must be passed by reference.");
-                       RETURN_FALSE;
-               }
                break;
        default:
                WRONG_PARAM_COUNT;
index 03daba8da2d3f67050d8b6fdbf342e904b57c30b..3a42ce8632b72ec90d0419e1fbc067ada6ffc44b 100644 (file)
@@ -2188,10 +2188,6 @@ PHP_FUNCTION(yaz_scan_result)
                {
                        WRONG_PARAM_COUNT;
                }
-               if (!ParameterPassedByReference(ht, 2))
-               {
-                       WRONG_PARAM_COUNT;
-               }
        }
        else if (ZEND_NUM_ARGS() == 1)
        {
@@ -2325,10 +2321,6 @@ PHP_FUNCTION(yaz_ccl_parse)
                WRONG_PARAM_COUNT;
        }
        
-       if (!ParameterPassedByReference(ht, 3)) {
-               php_error(E_WARNING, "Third argument must be passed by reference.");
-               RETURN_FALSE;
-       }
        pval_destructor(*pval_res);
        if (array_init(*pval_res) == FAILURE)
        {