1--TEST-- 2mysqli_close() 3--SKIPIF-- 4<?php 5require_once('skipif.inc'); 6require_once('skipifconnectfailure.inc'); 7?> 8--FILE-- 9<?php 10 require_once("connect.inc"); 11 12 $tmp = NULL; 13 $link = NULL; 14 15 if (!$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket)) 16 printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", 17 $host, $user, $db, $port, $socket); 18 19 $tmp = $mysqli->close(); 20 if (true !== $tmp) 21 printf("[003] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp); 22 23 try { 24 $mysqli->close(); 25 } catch (Error $exception) { 26 echo $exception->getMessage() . "\n"; 27 } 28 29 try { 30 $mysqli->query("SELECT 1"); 31 } catch (Error $exception) { 32 echo $exception->getMessage() . "\n"; 33 } 34 35 print "done!"; 36?> 37--EXPECT-- 38my_mysqli object is already closed 39my_mysqli object is already closed 40done! 41