@@ -1939,7 +1939,11 @@ static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_obje
1939
1939
zval retval ;
1940
1940
1941
1941
/* 1) use fgetcsv? 2) overloaded call the function, 3) do it directly */
1942
- if (SPL_HAS_FLAG (intern -> flags , SPL_FILE_OBJECT_READ_CSV ) || intern -> u .file .func_getCurr -> common .scope != spl_ce_SplFileObject ) {
1942
+ if (SPL_HAS_FLAG (intern -> flags , SPL_FILE_OBJECT_READ_CSV )) {
1943
+ return spl_filesystem_file_read_csv (intern , intern -> u .file .delimiter , intern -> u .file .enclosure , intern -> u .file .escape , NULL );
1944
+ }
1945
+ if (intern -> u .file .func_getCurr -> common .scope != spl_ce_SplFileObject ) {
1946
+ zend_execute_data * execute_data = EG (current_execute_data );
1943
1947
spl_filesystem_file_free_line (intern );
1944
1948
1945
1949
if (php_stream_eof (intern -> u .file .stream )) {
@@ -1948,11 +1952,6 @@ static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_obje
1948
1952
}
1949
1953
return FAILURE ;
1950
1954
}
1951
- if (SPL_HAS_FLAG (intern -> flags , SPL_FILE_OBJECT_READ_CSV )) {
1952
- return spl_filesystem_file_read_csv (intern , intern -> u .file .delimiter , intern -> u .file .enclosure , intern -> u .file .escape , NULL );
1953
- }
1954
-
1955
- zend_execute_data * execute_data = EG (current_execute_data );
1956
1955
zend_call_method_with_0_params (Z_OBJ_P (this_ptr ), Z_OBJCE_P (ZEND_THIS ), & intern -> u .file .func_getCurr , "getCurrentLine" , & retval );
1957
1956
if (Z_ISUNDEF (retval )) {
1958
1957
return FAILURE ;
@@ -2736,8 +2735,8 @@ PHP_METHOD(SplFileObject, seek)
2736
2735
}
2737
2736
}
2738
2737
if (line_pos > 0 ) {
2739
- intern -> u .file .current_line_num ++ ;
2740
2738
if (!SPL_HAS_FLAG (intern -> flags , SPL_FILE_OBJECT_READ_AHEAD )) {
2739
+ intern -> u .file .current_line_num ++ ;
2741
2740
spl_filesystem_file_free_line (intern );
2742
2741
}
2743
2742
}
0 commit comments