1--TEST--
2Trying to clone mysqli_result object
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once('skipifconnectfailure.inc');
8?>
9--FILE--
10<?php
11    require_once("connect.inc");
12
13    if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
14        printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
15            $host, $user, $db, $port, $socket);
16
17    if (!($res = mysqli_query($link, "SELECT 'good' AS morning")))
18        printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
19
20    $res_clone = clone $res;
21    print "done!";
22?>
23--EXPECTF--
24Fatal error: Uncaught Error: Trying to clone an uncloneable object of class mysqli_result in %s:%d
25Stack trace:
26#0 {main}
27  thrown in %s on line %d
28