8000 bug #38442 [VarDumper] fix truncating big arrays (nicolas-grekas) · symfony/symfony@c4aeb6f · GitHub
[go: up one dir, main page]

Skip to content

Commit c4aeb6f

Browse files
committed
bug #38442 [VarDumper] fix truncating big arrays (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [VarDumper] fix truncating big arrays | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | | Deprecations? | no | Tickets | Fix #38428 | License | MIT | Doc PR | - Commits ------- a8b986e [VarDumper] fix truncating big arrays
2 parents 9ffad84 + a8b986e commit c4aeb6f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Symfony/Component/VarDumper/Cloner/VarCloner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ protected function doClone($var)
247247
$stub->position = $len++;
248248
} elseif ($pos < $maxItems) {
249249
if ($maxItems < $pos += \count($a)) {
250-
$a = \array_slice($a, 0, $maxItems - $pos);
250+
$a = \array_slice($a, 0, $maxItems - $pos, true);
251251
if ($stub->cut >= 0) {
252252
$stub->cut += $pos - $maxItems;
253253
}

src/Symfony/Component/VarDumper/Tests/Cloner/VarClonerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public function testLimits()
162162
'Level 3 Item 3',
163163
],
164164
[
165-
'Level 3 Item 4',
165+
999 => 'Level 3 Item 4',
166166
'Level 3 Item 5',
167167
'Level 3 Item 6',
168168
],
@@ -242,7 +242,7 @@ public function testLimits()
242242
[1] => Array
243243
(
244244
[0] => 2
245-
[2] => 7
245+
[1] => 7
246246
)
247247
248248
[2] => Array
@@ -299,7 +299,7 @@ public function testLimits()
299299
300300
[7] => Array
301301
(
302-
[0] => Level 3 Item 4
302+
[999] => Level 3 Item 4
303303
)
304304
305305
)

0 commit comments

Comments
 (0)
0