note 63104 added to function.register-shutdown-function
| From: | dweingart at pobox dot com | Date: | Mon, 13 Mar 2006 16:53:09 +0000 |
| Subject: | note 63104 added to function.register-shutdown-function | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-105722@lists.php.net to get a copy of this message | ||
I have discovered a change in behavior from PHP 5.0.4 to PHP 5.1.2 when using a shutdown function in
conjunction with an output buffering callback.
In PHP 5.0.4 (and earlier versions I believe) the shutdown function is called after the output
buffering callback.
In PHP 5.1.2 (not sure when the change occurred) the shutdown function is called before the output
buffering callback.
Test code:
<?php
function ob_callback($buf) {
$buf .= '<li>' . __FUNCTION__ .'</li>';
return $buf;
}
function shutdown_func() {
echo '<li>' . __FUNCTION__ .'</li>';
}
ob_start('ob_callback');
register_shutdown_function('shutdown_func');
echo '<ol>';
?>
PHP 5.0.4:
1. ob_callback
2. shutdown_func
PHP 5.1.2:
1. shutdown_func
2. ob_callback
----
Server IP: 64.71.164.2
Probable Submitter: 207.190.225.90
----
X-Spam-Status: No, hits=3.3 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER,
HTML_MESSAGE autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.register-shutdown-function.php
Edit -- http://master.php.net/note/edit/63104
Del: integrated -- http://master.php.net/note/delete/63104/integrated
Del: useless -- http://master.php.net/note/delete/63104/useless
Del: bad code -- http://master.php.net/note/delete/63104/bad+code
Del: spam -- http://master.php.net/note/delete/63104/spam
Del: non-english -- http://master.php.net/note/delete/63104/non-english
Del: in docs -- http://master.php.net/note/delete/63104/in+docs
Del: other reasons-- http://master.php.net/note/delete/63104
Reject -- http://master.php.net/note/reject/63104
Search -- http://master.php.net/manage/user-notes.php