preg_replace
symfony/var-dumper
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Perform a regular expression search and replace
preg_replace
(
string
|array
$pattern
,
string
|array
$replacement
,
string
|array
$subject
,
int $limit
= -
1
,
int
&
$count
=
null
):
string
|array|
null
}
$line
.=
'pre.sf-dump .sf-dump-ellipsis-note{'
.
$this
->
styles
[
'note'
].
'}'
;
return
$this
->
dumpHeader
=
preg_replace
(
'/\s+/'
,
' '
,
$line
).
'</style>'
.
$this
->
dumpHeader
;
}
Dumper/HtmlDumper.php
$descriptor
->
describe
(
$output
, new
Data
([[
123
]]),
$context
+ [
'timestamp'
=>
1544804268.3668
],
1
);
$this
->
assertStringMatchesFormat
(
trim
(
$expectedOutput
),
trim
(
preg_replace
(
'@<style>.*</style><script>.*</script>@s'
,
''
,
$output
->
fetch
())));
}
public function
provideContext
()
Tests/Command/Descriptor/HtmlDescriptorTest.php
ob_start
();
$dumper
->
dump
(
$data
);
$out
=
ob_get_clean
();
$out
=
preg_replace
(
'/[ \t]+$/m'
,
''
,
$out
);
$intMax
=
\PHP_INT_MAX
;
$res
= (int)
$var
[
'res'
];
Tests/Dumper/CliDumperTest.php
ob_start
();
$dumper
->
dump
(
$data
);
$out
=
ob_get_clean
();
$out
=
preg_replace
(
'/[ \t]+$/m'
,
''
,
$out
);
$var
[
'file'
] =
htmlspecialchars
(
$var
[
'file'
],
\ENT_QUOTES
,
'UTF-8'
);
$intMax
=
\PHP_INT_MAX
;
preg_match
(
'/sf-dump-\d+/'
,
$out
,
$dumpId
);
Tests/Dumper/HtmlDumperTest.php