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