ID: 34377 Updated by: [EMAIL PROTECTED] Reported By: freddie at bingham dot net -Status: Open +Status: Bogus Bug Type: MySQLi related Operating System: Windows XP PHP Version: 5.1.0RC1 New Comment:
Object destructors are executed before the request shutdown functions set by users. This will not change. Please don't submit any more duplicate reports about this issue. Previous Comments: ------------------------------------------------------------------------ [2005-09-05 17:52:06] freddie at bingham dot net Description: ------------ This bug (http://bugs.php.net/bug.php?id=33635) reports the same php error but involves session handlers. This bug (http://bugs.php.net/bug.php?id=33772) describes a possible reason this problem to be working as designed. As reported bu the php team: "This is chicken/egg problem and it cannot be solved. One expect that destructors are called before session close the other uses object for save handlers." Are we to assume that a change has been made that is calling destructors before session close? Fine, but why is this affecting register_shutdown? If register_shutdown() is part of the request, we expect to have access to the same scope. Secondly why is this just affecting MySQLi? Go ahead and reproduce the example code using MySQL and you'll see that it works as expected. Reproduce code: --------------- function shutdown() { global $link; echo mysqli_real_escape_string($link, 'foo'); } $servername = 'localhost'; $username = 'username'; $password = 'password'; $link = mysqli_init(); mysqli_real_connect($link, $servername, $username, $password); echo mysqli_real_escape_string($link, 'foo') . '<br />'; register_shutdown_function('shutdown'); Expected result: ---------------- foo foo Actual result: -------------- foo Warning: Couldn't fetch mysqli in c:\program files\apache group\Apache\htdocs\foo.php on line 7 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34377&edit=1
