mirror of
https://github.com/php/php-src.git
synced 2024-11-27 11:53:33 +08:00
ext/mysqi: mysqli_poll raises a ValueError on absent 1st and 2ng arguments.
This commit is contained in:
parent
394470c052
commit
90a39fd52c
@ -95,6 +95,8 @@ PHP 8.3 UPGRADE NOTES
|
||||
- mysqli:
|
||||
. mysqli_fetch_object now raises a ValueError instead of an Exception when the constructor_args
|
||||
argument is non empty with the class not having constructor.
|
||||
. mysqli_poll now raises a ValueError when the read nor error arguments are passed.
|
||||
|
||||
- PGSQL:
|
||||
. pg_fetch_object now raises a ValueError instead of an Exception when the constructor_args
|
||||
argument is non empty with the class not having constructor.
|
||||
|
@ -762,10 +762,9 @@ PHP_FUNCTION(mysqli_poll)
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
// TODO Error promotion
|
||||
if (!r_array && !e_array) {
|
||||
php_error_docref(NULL, E_WARNING, "No stream arrays were passed");
|
||||
RETURN_FALSE;
|
||||
zend_value_error("No stream arrays were passed");
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
if (r_array != NULL) {
|
||||
|
@ -10,15 +10,23 @@ require_once("connect.inc");
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
$tablica = array();
|
||||
$test1 = mysqli_poll($test2, $test3, $tablica, 0);
|
||||
try {
|
||||
$test1 = mysqli_poll($test2, $test3, $tablica, 0);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
|
||||
$test2 = array();
|
||||
$test2 = array();
|
||||
$test1 = mysqli_poll($test2, $test3, $tablica, 0);
|
||||
try {
|
||||
$test1 = mysqli_poll($test2, $test3, $tablica, 0);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
echo "okey";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: mysqli_poll(): No stream arrays were passed in %sbug62885.php on line %d
|
||||
No stream arrays were passed
|
||||
|
||||
Warning: mysqli_poll(): No stream arrays were passed in %sbug62885.php on line %d
|
||||
Warning: mysqli_poll(): No stream arrays were passed in %s on line %d
|
||||
okey
|
||||
|
Loading…
Reference in New Issue
Block a user