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
-------
a8b986e35e
[VarDumper] fix truncating big arrays
This commit is contained in:
commit
c4aeb6fd80
@ -247,7 +247,7 @@ class VarCloner extends AbstractCloner
|
||||
$stub->position = $len++;
|
||||
} elseif ($pos < $maxItems) {
|
||||
if ($maxItems < $pos += \count($a)) {
|
||||
$a = \array_slice($a, 0, $maxItems - $pos);
|
||||
$a = \array_slice($a, 0, $maxItems - $pos, true);
|
||||
if ($stub->cut >= 0) {
|
||||
$stub->cut += $pos - $maxItems;
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ EOTXT;
|
||||
'Level 3 Item 3',
|
||||
],
|
||||
[
|
||||
'Level 3 Item 4',
|
||||
999 => 'Level 3 Item 4',
|
||||
'Level 3 Item 5',
|
||||
'Level 3 Item 6',
|
||||
],
|
||||
@ -242,7 +242,7 @@ Symfony\Component\VarDumper\Cloner\Data Object
|
||||
[1] => Array
|
||||
(
|
||||
[0] => 2
|
||||
[2] => 7
|
||||
[1] => 7
|
||||
)
|
||||
|
||||
[2] => Array
|
||||
@ -299,7 +299,7 @@ Symfony\Component\VarDumper\Cloner\Data Object
|
||||
|
||||
[7] => Array
|
||||
(
|
||||
[0] => Level 3 Item 4
|
||||
[999] => Level 3 Item 4
|
||||
)
|
||||
|
||||
)
|
||||
|
Reference in New Issue
Block a user