symfony: Call to undefined method Symfony\Component\VarDumper\Caster\CutStub::clear()
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | yes |
RFC? | no |
Symfony version | 3.3.2 |
I just upgraded from 3.2.x to 3.3.2, ran my test suite, and got this:
PHPUnit 6.2.1 by Sebastian Bergmann and contributors.
......................E
Time: 17.47 seconds, Memory: 153.28MB
There was 1 error:
1) Tests\My\Project\MyTestCase::myTest
Error: Call to undefined method Symfony\Component\VarDumper\Caster\CutStub::clear()
my-project/var/cache/test/appTestDebugProjectContainer.php:8865
my-project/vendor/doctrine/doctrine-bundle/DoctrineBundle.php:123
my-project/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:155
my-project/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php:193
my-project/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php:205
my-project/tests/My/Project/ApiTestCase.php:112
Inspecting the CutStub
class reveals that, indeed, it does not have a clear()
method.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 3
- Comments: 36 (30 by maintainers)
Commits related to this issue
- bug #23465 [HttpKernel][VarDumper] Truncate profiler data & optim perf (nicolas-grekas) This PR was merged into the 3.3 branch. Discussion ---------- [HttpKernel][VarDumper] Truncate profiler data ... — committed to symfony/symfony by nicolas-grekas 7 years ago
- bug #24906 [Bridge/ProxyManager] Remove direct reference to value holder property (nicolas-grekas) This PR was merged into the 2.7 branch. Discussion ---------- [Bridge/ProxyManager] Remove direct ... — committed to symfony/symfony by fabpot 7 years ago
This is the minimum version to reproduce that I was able to achieve: https://github.com/ossinkine/symfony-standard/tree/issue-23110 This is Symfony Standard edition with installed Sonata admin and Vich uploader bundles and Doctrine migrations package. I ran test in a container based on
php:alpine
with installed opache (docker-php-ext-install opcache
). If disable one of Vich uploader, Migrations or Opcache, all work.@stof Yes! The profiler was enabled, and disabling it solves the problem!
@nicodemuz I got the same issue like you after upgrading symfony
6.1
to6.2
(onPHP 8.1
). Got it solved by upgrading toPHP 8.2
… so I didn’t investigate further.I’m facing the same issue on my CI machine when upgrading from Symfony 5.4 to Symfony 6.2.
My test also uses
$client->enableProfiler();
. My application code also uses EntityType::class.Here is the relevant code from my test case:
@nicolas-grekas any idea?
@Invis1ble of course: it has been fixed in v3.3.11.
Should be fixed by #23465
WTF. How are we ending up with a CutStub in a property of the proxy class. @nicolas-grekas could it be that the class property is accessed by reference when building the dumping info, and then the dumping info is modified to add a CutStub ? I don’t see another way here (but I may miss something due to the magic happening in ProxyManager)
Likewise, my application is large and proprietary. I’ll try to find some time to dig deeper so I can provide more helpful information.