ID:               39546
 Updated by:       [EMAIL PROTECTED]
 Reported By:      lasse at cederstrom dot dk
-Status:           Open
+Status:           Bogus
 Bug Type:         Output Control
 Operating System: FreeBSD
 PHP Version:      5.2.0
 New Comment:

The current shutdown order has been discussed numerous times and it was
decided to leave it as it is at the moment, i.e. 
1. shutdown functions
2. destructors
3. output buffers
4. HTTP headers
5. modules request shutdown
6. globals
.. others.

For more information about this chicked-and-egg problem you can look in
the internals@ list and in existing bug reports.



Previous Comments:
------------------------------------------------------------------------

[2006-11-17 14:05:04] lasse at cederstrom dot dk

Description:
------------
When the code reaches the callback function for ob_start, the objects
in $GLOBALS have been destructed.

In earlier versions of php they were not destructed at this point,
making it possible to use $GLOBALS['object']->func() in output()

This is new behaviour for 5.2

Reproduce code:
---------------
<?php

class dims
{
        function x()
        {
                return "Muhahahaha";
        }
        function __destruct()
        {
                echo "IM GOING DOWN!!!";
        }
}

$GLOBALS['d'] = new dims();
function output($buffer)
{
        var_dump($GLOBALS);
        return false;
}
ob_start('output');
?>

This is a test
<hr>
<?php
        var_dump($GLOBALS);
?>


Expected result:
----------------
To have $GLOBALS['d'] still be there when reaching output()

Actual result:
--------------
$GLOBALS['d'] should still be available in output()


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=39546&edit=1

Reply via email to