ID: 51052 Updated by: [email protected] Reported By: trobinson at gksystems dot com -Status: Open +Status: Bogus Bug Type: Feature/Change Request PHP Version: 5.3.1 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php The shutdown order is full of chicken and egg problems and we try to avoid touching it as far as possible. If there ever will be a change it will be well thought ... but I don't expect a change. Previous Comments: ------------------------------------------------------------------------ [2010-02-15 22:24:26] trobinson at gksystems dot com Description: ------------ I have a templating system which replaces placeholders with MySQL-derived content, using an output buffer handler. Any html file can be used as a template, by placing one line at the top of the file: <?php include('mysetup.php'); ?> The beauty of output control EOF handling is that there is no need to add any PHP code at the *end* of the html file. mysetup.php connects to a MySQL database, does some db work, then calls ob_start('myhandler'); As of PHP 5.1.x, all objects are destroyed before calling myhandler. If I used mysqli_connect within mysetup, my db connection has been closed, so I need to reconnect in myhandler. However, if I used mysql_connect then my db connection is still valid within myhandler. I discovered this when upgrading my code to use mysqli. I'm switching back to mysql, to avoid the overhead of connecting to the database twice. It seems to me that it is a bit heavy-handed to destroy all objects before calling an output handler. It would be more reasonable to destroy just those objects created after registering the output handler. MY FEATURE REQUEST: Please don't *break* the current behaviour of the mysql extension in a future version of PHP. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=51052&edit=1
