Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / tests / lang / bug30578.phpt
blobd8a8d2e54f8d35822c34d892ab9ec595cab99ef3
1 --TEST--
2 Bug #30578 (Output buffers flushed before calling __desctruct functions) 
3 --FILE--
4 <?php
6 error_reporting(E_ALL);
8 class Example
10     function __construct()
11     {
12         ob_start();
13         echo "This should be displayed last.\n";
14     }
16     function __destruct()
17     {
18         $buffered_data = ob_get_contents();
19         ob_end_clean();
21         echo "This should be displayed first.\n";
22         echo "Buffered data: $buffered_data";
23     }
26 $obj = new Example;
29 --EXPECT--
30 This should be displayed first.
31 Buffered data: This should be displayed last.