stream_get_contents
symfony/var-dumper
Supported Versions: PHP 5, PHP 7, PHP 8
Reads remainder of a stream into a string
stream_get_contents
(
resource $stream
, ?
int $length
=
null
,
int $offset
= -
1
):
string
|
false
$this
->
dumpLine
(-
1
);
if (
$returnDump
) {
$result
=
stream_get_contents
(
$output
, -
1
,
0
);
fclose
(
$output
);
return
$result
;
Dumper/AbstractDumper.php
$data
=
$cloner
->
cloneVar
(
$out
);
$dumper
->
dump
(
$data
,
$out
);
$out
=
stream_get_contents
(
$out
, -
1
,
0
);
$this
->
assertStringMatchesFormat
(
<<<
EOTXT
Tests/Dumper/CliDumperTest.php
$dumper
->
dump
(
$cloner
->
cloneVar
(
123
),
$out
);
$dumper
->
dump
(
$cloner
->
cloneVar
(
456
),
$out
);
$out
=
stream_get_contents
(
$out
, -
1
,
0
);
$this
->
assertSame
(<<<'EOTXT'
<foo></foo><bar><span class=sf-dump-num>123</span>
Tests/Dumper/HtmlDumperTest.php