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 $valid = array(MYSQLI_STORE_RESULT, MYSQLI_USE_RESULT); 19 $invalidModes = [-1, 152]; 20 foreach ($invalidModes as $mode) { 21 try { 22 new mysqli_result($link, $mode); 23 } catch (\ValueError $e) { 24 echo $e->getMessage() . \PHP_EOL; 25 } 26 } 27?> 28--EXPECT-- 29mysqli_result::__construct(): Argument #2 ($result_mode) must be either MYSQLI_STORE_RESULT or MYSQLI_USE_RESULT 30mysqli_result::__construct(): Argument #2 ($result_mode) must be either MYSQLI_STORE_RESULT or MYSQLI_USE_RESULT 31