File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/Symfony/Component/VarDumper/Cloner Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -94,13 +94,16 @@ protected function doClone($var)
94
94
// Create $stub when the original value $v can not be used directly
95
95
// If $v is a nested structure, put that structure in array $a
96
96
switch (true ) {
97
- case empty ($ v ):
98
- case true === $ v :
97
+ case \is_null ($ v ):
98
+ case \is_bool ( $ v ) :
99
99
case \is_int ($ v ):
100
100
case \is_float ($ v ):
101
101
continue 2 ;
102
102
103
103
case \is_string ($ v ):
104
+ if ('' === $ v ) {
105
+ continue 2 ;
106
+ }
104
107
if (!\preg_match ('//u ' , $ v )) {
105
108
$ stub = new Stub ();
106
109
$ stub ->type = Stub::TYPE_STRING ;
@@ -124,6 +127,9 @@ protected function doClone($var)
124
127
break ;
125
128
126
129
case \is_array ($ v ):
130
+ if (!$ v ) {
131
+ continue 2 ;
132
+ }
127
133
$ stub = $ arrayStub ;
128
134
$ stub ->class = Stub::ARRAY_INDEXED ;
129
135
You can’t perform that action at this time.
0 commit comments