]> granicus.if.org Git - php/commitdiff
Make range operate on the copies of the parameters rather then modify the
authorIlia Alshanetsky <iliaa@php.net>
Wed, 25 Dec 2002 20:02:03 +0000 (20:02 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 25 Dec 2002 20:02:03 +0000 (20:02 +0000)
actual parameters.

ext/standard/array.c

index 187d4577709f5269f55b925ac6acb257dd918d7a..caf322e4744d5d9f18c9d7cc7b5170d5c95cac2c 100644 (file)
@@ -1425,7 +1425,7 @@ PHP_FUNCTION(range)
        int err = 0, is_step_double = 0;
        double step = 1.0;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|z", &zlow, &zhigh, &zstep) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z/|z/", &zlow, &zhigh, &zstep) == FAILURE) {
                RETURN_FALSE;
        }
 
@@ -1461,8 +1461,8 @@ PHP_FUNCTION(range)
                        goto long_str;
                }
                
-               convert_to_string_ex(&zlow);
-               convert_to_string_ex(&zhigh);
+               convert_to_string(zlow);
+               convert_to_string(zhigh);
                low = (unsigned char *)Z_STRVAL_P(zlow);
                high = (unsigned char *)Z_STRVAL_P(zhigh);
 
@@ -1488,8 +1488,8 @@ PHP_FUNCTION(range)
        } else if (Z_TYPE_P(zlow) == IS_DOUBLE || Z_TYPE_P(zhigh) == IS_DOUBLE || is_step_double) {
                double low, high;
 double_str:            
-               convert_to_double_ex(&zlow);
-               convert_to_double_ex(&zhigh);
+               convert_to_double(zlow);
+               convert_to_double(zhigh);
                low = Z_DVAL_P(zlow);
                high = Z_DVAL_P(zhigh);
                
@@ -1516,8 +1516,8 @@ double_str:
                int low, high;
                long lstep;
 long_str:
-               convert_to_long_ex(&zlow);
-               convert_to_long_ex(&zhigh);
+               convert_to_long(zlow);
+               convert_to_long(zhigh);
                low = Z_LVAL_P(zlow);
                high = Z_LVAL_P(zhigh);
                lstep = (long) step;