Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[VarDumper] Add tests to demonstrate a bug when dumping ArrayObject with full stack fmk#50940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
lyrixx wants to merge1 commit intosymfony:5.4fromlyrixx:var-dump-bim-bam-boom

Conversation

@lyrixx
Copy link
Member

@lyrixxlyrixx commentedJul 11, 2023
edited
Loading

QA
Branch?5.4
Bug fix?not yet
New feature?no
Deprecations?no
Tickets
LicenseMIT
Doc PR

I had hard time to find a very minimal reproducer!
I think the issue is here, where we update the stub:

foreach ($itemas$stub->class =>$stub->position) {

I spent a bit too much time on this one, so I cannot go further. Sorry, this is the best I can dot ATM

Current errors

PHPUnit 9.6.9 by Sebastian Bergmann and contributors.Warning:       Your XML configuration validates against a deprecated schema.Suggestion:    Migrate your XML configuration using "--migrate-configuration"!Testing /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Tests/IntegrationFF                                                                  2 / 2 (100%)Time: 00:00.094, Memory: 10.00 MBThere were 2 failures:1) /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Tests/Integration/dump_data_collector.phptFailed asserting that string matches format description.--- Expected+++ Actual@@ @@-ArrayObject {#%d-  -storage: []-  flag::STD_PROP_LIST: false-  flag::ARRAY_AS_PROPS: false-  iteratorClass: "ArrayIterator"-}+tandard input code on line 31:+ArrayObject {#24++Fatal error: Uncaught TypeError: Illegal offset type in /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Cloner/Data.php:464+Stack trace:+#0 /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Cloner/Data.php(340): Symfony\Component\VarDumper\Cloner\Data->getStub()+#1 /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Cloner/Data.php(440): Symfony\Component\VarDumper\Cloner\Data->dumpItem()+#2 /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Cloner/Data.php(402): Symfony\Component\VarDumper\Cloner\Data->dumpChildren()+#3 /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Cloner/Data.php(321): Symfony\Component\VarDumper\Cloner\Data->dumpItem()+#4 /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php(135): Symfony\Component\VarDumper\Cloner\Data->dump()+#5 /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php(290): Symfony\Component\VarDumper\Dumper\AbstractDumper->dump()+#6 /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php(253): Symfony\Component\HttpKernel\DataCollector\DumpDataCollector->doDump()+#7 [internal function]: Symfony\Component\HttpKernel\DataCollector\DumpDataCollector->__destruct()+#8 {main}+  thrown in /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Cloner/Data.php on line 464/home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Tests/Integration/dump_data_collector.phpt:382) /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Tests/Integration/dump_data_collector2.phptFailed asserting that string matches format description.--- Expected+++ Actual@@ @@-ArrayObject {#%d-  -storage: []-  flag::STD_PROP_LIST: false-  flag::ARRAY_AS_PROPS: false-  iteratorClass: "ArrayIterator"-}+tandard input code on line 31:+ArrayObject {#24++Warning: Undefined array key "A" in /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Cloner/Data.php on line 464++Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Cloner/Data.php:464+Stack trace:+#0 /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Cloner/Data.php(340): Symfony\Component\VarDumper\Cloner\Data->getStub()+#1 /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Cloner/Data.php(440): Symfony\Component\VarDumper\Cloner\Data->dumpItem()+#2 /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Cloner/Data.php(402): Symfony\Component\VarDumper\Cloner\Data->dumpChildren()+#3 /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Cloner/Data.php(321): Symfony\Component\VarDumper\Cloner\Data->dumpItem()+#4 /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php(135): Symfony\Component\VarDumper\Cloner\Data->dump()+#5 /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php(290): Symfony\Component\VarDumper\Dumper\AbstractDumper->dump()+#6 /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php(253): Symfony\Component\HttpKernel\DataCollector\DumpDataCollector->doDump()+#7 [internal function]: Symfony\Component\HttpKernel\DataCollector\DumpDataCollector->__destruct()+#8 {main}+  thrown in /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Cloner/Data.php on line 464/home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Component/VarDumper/Tests/Integration/dump_data_collector2.phpt:38FAILURES!Tests: 2, Assertions: 2, Failures: 2.

@carsonbotcarsonbot added this to the5.4 milestoneJul 11, 2023
nicolas-grekas added a commit that referenced this pull requestJul 13, 2023
…tor` (lyrixx, HypeMC)This PR was merged into the 5.4 branch.Discussion----------[VarDumper] Fix dumping `ArrayObject` with `DumpDataCollector`| Q             | A| ------------- | ---| Branch?       | 5.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       |Fix#50940| License       | MIT| Doc PR        | -The main problem here is that the `ArrayObjectstorage` key in [the array returned by `__debugInfo()`](https://github.com/symfony/symfony/blob/de7ab4d85dcc94032b77f1a15d7a030714a1f734/src/Symfony/Component/VarDumper/Caster/SplCaster.php#L229-L229) seems to be a reference:https://3v4l.org/8rSFn (a bug in PHP perhaps?)Since the `DumpDataCollector` does the actual dumping in the `__destructor()` the `ArrayObjectstorage` is modified by then which messes with the object created by the `VarCloner`.Commits-------b25f377 [VarDumper] Fix dumping `ArrayObject` with `DumpDataCollector`1f2c6f7 [VarDumper] Add tests to demonstrate a bug when dumping ArrayObject with full stack fmk
@lyrixxlyrixx deleted the var-dump-bim-bam-boom branchJuly 13, 2023 09:56
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

3 participants

@lyrixx@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp