On Aug 23, 2006, at 2:33 AM, Jochem Maas wrote:
how do you know which object is destroyed first?
also you are using 3 different versions of php - not something that
will
help narrow down the problem.
Richard K Miller wrote:
Good afternoon. I'm getting a weird mysqli error in my object
destructor. Here's an example:
<?php
$db = new mysqli('localhost', USERNAME, PASSWORD, DATABASE);
class Test
{
function __construct()
{
global $db;
$db->query("SELECT 'test'");
print_r($db->error);
}
function __destruct()
{
global $db;
$db->query("SELECT 'test'"); // line 20
print_r($db->error); // line 21
}
}
$test = new Test();
what happens if you add the following line:
unset($test);
No errors when I use unset(). I see what you mean about not knowing
which object is destroyed first. Maybe I'll have to use a non-OOP
connection to MySQL, since it wouldn't appear there's any way to
specify the order of destruction of objects.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php