We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
get_dump
1 parent b38d58e commit 9fcc57fCopy full SHA for 9fcc57f
src/dump.php
@@ -0,0 +1,25 @@
1
+<?php
2
+
3
+use Symfony\Component\VarDumper\Cloner\VarCloner;
4
+use Symfony\Component\VarDumper\Dumper\CliDumper;
5
6
+if (!function_exists('get_dump')) {
7
+ function get_dump($var)
8
+ {
9
+ $cloner = new VarCloner();
10
+ $cloner->setMaxItems(-1);
11
+ $cloner->setMaxString(-1);
12
13
+ $cloned = $cloner->cloneVar($var);
14
+ $cloned->withMaxDepth(-1);
15
+ $cloned->withMaxItemsPerDepth(-1);
16
+ $cloned->withRefHandles(-1);
17
18
+ $dumper = new CliDumper();
19
+ $dumper->setIndentPad(' ');
20
+ $output = fopen('php://memory', 'r+b');
21
+ $dumper->dump($cloned, $output);
22
23
+ return stream_get_contents($output, -1, 0);
24
+ }
25
+}
0 commit comments