php-src/ext/mysqli/tests/mysqli_result_unclonable.phpt
Ulf Wendel 613947afc6 Tests which verify that you really cannot clone any of the mysqli
objects. Technically it might be possible to tweak ext/mysqli and make
the objects cloneable - tough, we haven't checked in depth.

So, if one is interested, raise a discussion.
2007-07-23 12:34:09 +00:00

21 lines
686 B
PHP

--TEST--
Trying to clone mysqli_result object
--SKIPIF--
<?php require_once('skipif.inc'); ?>
<?php require_once('skipifemb.inc'); ?>
--FILE--
<?php
include "connect.inc";
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
$host, $user, $db, $port, $socket);
if (!($res = mysqli_query($link, "SELECT 'good' AS morning")))
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$res_clone = clone $res;
print "done!";
?>
--EXPECTF--
Fatal error: Trying to clone an uncloneable object of class mysqli_result in %s on line %d