HEX
Server: Apache/2.4.41 (Amazon) OpenSSL/1.0.2k-fips PHP/5.6.40
System: Linux ip-172-31-40-18 4.14.146-93.123.amzn1.x86_64 #1 SMP Tue Sep 24 00:45:23 UTC 2019 x86_64
User: apache (48)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: //usr/share/pear/test/pecl_http/tests/envresponse015.phpt
--TEST--
env response send replaced body using multiple ob_start
--SKIPIF--
<?php
include "skipif.inc";
?>
--FILE--
<?php

$r = new http\Env\Response;

ob_start($r);
echo "bar";
ob_end_flush();

$b = $r->getBody();
$r->setBody(new http\Message\Body);

ob_start($r);
echo "foo: $b\n";
ob_end_flush();

$f = fopen("php://memory", "r+");

$r->send($f);

fseek($f, 0, SEEK_SET);
echo stream_get_contents($f);

?>
--EXPECT--
HTTP/1.1 200 OK
Accept-Ranges: bytes
ETag: "fc8305a1"

foo: bar