1--TEST--
2mysqli_result(), invalid mode
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once 'skipifconnectfailure.inc';
8?>
9--FILE--
10<?php
11    require_once 'connect.inc';
12    if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
13        printf("Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
14            $host, $user, $db, $port, $socket);
15        exit(1);
16    }
17
18    $invalidModes = [-1, 152];
19    foreach ($invalidModes as $mode) {
20        try {
21            new mysqli_result($link, $mode);
22        } catch (\ValueError $e) {
23            echo $e->getMessage() . \PHP_EOL;
24        }
25    }
26?>
27--EXPECT--
28mysqli_result::__construct(): Argument #2 ($result_mode) must be either MYSQLI_STORE_RESULT or MYSQLI_USE_RESULT
29mysqli_result::__construct(): Argument #2 ($result_mode) must be either MYSQLI_STORE_RESULT or MYSQLI_USE_RESULT
30