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 @@ -21,6 +21,10 @@ PHP NEWS
2121- Opcache:
2222 . opcache_get_configuration() properly reports jit_prof_threshold. (cmb)
2323
24+ - PgSql:
25+ . Fixed bug GH-17158 (pg_fetch_result Shows Incorrect ArgumentCountError
26+ Message when Called With 1 Argument). (nielsdos)
27+
2428- SimpleXML:
2529 . Fixed bug GH-17040 (SimpleXML's unset can break DOM objects). (nielsdos)
2630
Original file line number Diff line number Diff line change @@ -1710,7 +1710,7 @@ PHP_FUNCTION(pg_fetch_result)
17101710 Z_PARAM_OBJECT_OF_CLASS (result , pgsql_result_ce )
17111711 Z_PARAM_STR_OR_LONG (field_name , field_offset )
17121712 ZEND_PARSE_PARAMETERS_END ();
1713- } else {
1713+ } else if ( ZEND_NUM_ARGS () == 3 ) {
17141714 ZEND_PARSE_PARAMETERS_START (3 , 3 )
17151715 Z_PARAM_OBJECT_OF_CLASS (result , pgsql_result_ce )
17161716 if (zend_string_equals_literal (EG (current_execute_data )-> func -> common .function_name , "pg_result" )) {
@@ -1720,6 +1720,9 @@ PHP_FUNCTION(pg_fetch_result)
17201720 }
17211721 Z_PARAM_STR_OR_LONG (field_name , field_offset )
17221722 ZEND_PARSE_PARAMETERS_END ();
1723+ } else {
1724+ zend_wrong_parameters_count_error (2 , 3 );
1725+ RETURN_THROWS ();
17231726 }
17241727
17251728 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