@@ -1901,13 +1901,13 @@ static int spl_filesystem_file_read(spl_filesystem_object *intern, int silent) /
1901
1901
return SUCCESS ;
1902
1902
} /* }}} */
1903
1903
1904
- static int spl_filesystem_file_call (spl_filesystem_object * intern , zend_function * func_ptr , int pass_num_args , zval * return_value , zval * arg2 ) /* {{{ */
1904
+ static int spl_filesystem_file_call (spl_filesystem_object * intern , zend_function * func_ptr , int pass_num_args , zval * return_value ) /* {{{ */
1905
1905
{
1906
1906
zend_fcall_info fci ;
1907
1907
zend_fcall_info_cache fcic ;
1908
1908
zval * zresource_ptr = & intern -> u .file .zresource , * params ;
1909
1909
int result ;
1910
- int num_args = pass_num_args + ( arg2 ? 2 : 1 ) ;
1910
+ int num_args = pass_num_args + 1 ;
1911
1911
1912
1912
if (Z_ISUNDEF_P (zresource_ptr )) {
1913
1913
zend_throw_exception_ex (spl_ce_RuntimeException , 0 , "Object not initialized" );
@@ -1917,11 +1917,7 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function
1917
1917
params = (zval * )safe_emalloc (num_args , sizeof (zval ), 0 );
1918
1918
params [0 ] = * zresource_ptr ;
1919
1919
1920
- if (arg2 ) {
1921
- params [1 ] = * arg2 ;
1922
- }
1923
-
1924
- if (zend_get_parameters_array_ex (pass_num_args , params + (arg2 ? 2 : 1 )) != SUCCESS ) {
1920
+ if (zend_get_parameters_array_ex (pass_num_args , params + 1 ) != SUCCESS ) {
1925
1921
efree (params );
1926
1922
WRONG_PARAM_COUNT_WITH_RETVAL (FAILURE );
1927
1923
}
@@ -1948,15 +1944,15 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function
1948
1944
return result ;
1949
1945
} /* }}} */
1950
1946
1951
- #define FileFunctionCall (func_name , pass_num_args , arg2 ) /* {{{ */ \
1947
+ #define FileFunctionCall (func_name , pass_num_args ) /* {{{ */ \
1952
1948
{ \
1953
1949
zend_function *func_ptr; \
1954
1950
func_ptr = (zend_function *)zend_hash_str_find_ptr(EG(function_table), #func_name, sizeof(#func_name) - 1); \
1955
1951
if (func_ptr == NULL) { \
1956
1952
zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Internal error, function %s() not found. Please report", #func_name); \
1957
1953
return; \
1958
1954
} \
1959
- spl_filesystem_file_call(intern, func_ptr, pass_num_args, return_value, arg2 ); \
1955
+ spl_filesystem_file_call(intern, func_ptr, pass_num_args, return_value); \
1960
1956
} /* }}} */
1961
1957
1962
1958
static int spl_filesystem_file_read_csv (spl_filesystem_object * intern , char delimiter , char enclosure , int escape , zval * return_value ) /* {{{ */
@@ -2387,7 +2383,7 @@ PHP_METHOD(SplFileObject, getChildren)
2387
2383
PHP_METHOD(SplFileObject, func_name) \
2388
2384
{ \
2389
2385
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS); \
2390
- FileFunctionCall(func_name, ZEND_NUM_ARGS(), NULL ); \
2386
+ FileFunctionCall(func_name, ZEND_NUM_ARGS()); \
2391
2387
}
2392
2388
/* }}} */
2393
2389
@@ -2681,7 +2677,7 @@ PHP_METHOD(SplFileObject, fscanf)
2681
2677
spl_filesystem_file_free_line (intern );
2682
2678
intern -> u .file .current_line_num ++ ;
2683
2679
2684
- FileFunctionCall (fscanf , ZEND_NUM_ARGS (), NULL );
2680
+ FileFunctionCall (fscanf , ZEND_NUM_ARGS ());
2685
2681
}
2686
2682
/* }}} */
2687
2683
0 commit comments