File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed
Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ PHP NEWS
3636- Opcache:
3737 . opcache_get_configuration() properly reports jit_prof_threshold. (cmb)
3838
39+ - PgSql:
40+ . Fixed bug GH-17158 (pg_fetch_result Shows Incorrect ArgumentCountError
41+ Message when Called With 1 Argument). (nielsdos)
42+
3943- SimpleXML:
4044 . Fixed bug GH-17040 (SimpleXML's unset can break DOM objects). (nielsdos)
4145
Original file line number Diff line number Diff line change @@ -1893,7 +1893,7 @@ PHP_FUNCTION(pg_fetch_result)
18931893 Z_PARAM_OBJECT_OF_CLASS (result , pgsql_result_ce )
18941894 Z_PARAM_STR_OR_LONG (field_name , field_offset )
18951895 ZEND_PARSE_PARAMETERS_END ();
1896- } else {
1896+ } else if ( ZEND_NUM_ARGS () == 3 ) {
18971897 ZEND_PARSE_PARAMETERS_START (3 , 3 )
18981898 Z_PARAM_OBJECT_OF_CLASS (result , pgsql_result_ce )
18991899 if (zend_string_equals_literal (EG (current_execute_data )-> func -> common .function_name , "pg_result" )) {
@@ -1903,6 +1903,9 @@ PHP_FUNCTION(pg_fetch_result)
19031903 }
19041904 Z_PARAM_STR_OR_LONG (field_name , field_offset )
19051905 ZEND_PARSE_PARAMETERS_END ();
1906+ } else {
1907+ zend_wrong_parameters_count_error (2 , 3 );
1908+ RETURN_THROWS ();
19061909 }
19071910
19081911 pg_result = Z_PGSQL_RESULT_P (result );
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-17158 (pg_fetch_result Shows Incorrect ArgumentCountError Message when Called With 1 Argument)
3+ --EXTENSIONS--
4+ pgsql
5+ --FILE--
6+ <?php
7+
8+ try {
9+ pg_fetch_result (null );
10+ } catch (ArgumentCountError $ e ) {
11+ echo $ e ->getMessage (), "\n" ;
12+ }
13+
14+ ?>
15+ --EXPECT--
16+ pg_fetch_result() expects at least 2 arguments, 1 given
You can’t perform that action at this time.
0 commit comments