Comments (4)
@jnvsor WHAO, you're Speedy Gonzales! Fastest mouse in Mexico 🚀
(No idea if that cartoon has the same name anywhere in the world, like in Germany xD)
Yes, perfect! Working just fine, thanks for the lightning fast fix!
from kint.
Should be fixed in 055630e
from kint.
Thanks @jnvsor,
we're using 5.0.6 and the issue still appears. I guess it should be fixed in this version?
For us it happens in Drupal 10.
The partial backtrace is:
TypeError: Cannot assign stdClass to reference held by property Symfony\Component\HttpFoundation\Session\Flash\FlashBag::$flashes of type array in Kint\Parser\Parser->parseArray() (line 377 of /vendor/kint-php/kint/src/Parser/Parser.php).
Kint\Parser\Parser->parse() (Line: 565)
Kint\Parser\Parser->parseObject() (Line: 138)
Kint\Parser\Parser->parse() (Line: 565)
Kint\Parser\Parser->parseObject() (Line: 138)
Kint\Parser\Parser->parse() (Line: 565)
Kint\Parser\Parser->parseObject() (Line: 138)
Kint\Parser\Parser->parse() (Line: 565)
Kint\Parser\Parser->parseObject() (Line: 138)
Kint\Parser\Parser->parse() (Line: 285)
Kint\Kint->dumpVar() (Line: 268)
Kint\Kint->dumpAll() (Line: 575)
Kint\Kint::dump() (Line: 64)
Drupal\devel\Plugin\Devel\Dumper\Kint->export() (Line: 105)
Drupal\devel\DevelDumperManager->export() (Line: 115)
Drupal\devel\DevelDumperManager->message() (Line: 183)
Drupal\devel\Twig\Extension\Debug->message() (Line: 44)
__TwigTemplate_1bb3a20a3f4847fc1af463271334acbf->doDisplay() (Line: 394)
Twig\Template->displayWithErrorHandling() (Line: 367)
Twig\Template->display() (Line: 379)
Twig\Template->render() (Line: 40)
Twig\TemplateWrapper->render() (Line: 53)
twig_render_template() (Line: 372)
Does that help?
Seems like it appeared with the Drupal 10 Upgrade which uses Symfony 6.2. With Drupal 9 we never had that issue before. Should this be reopened?
from kint.
While it seems obvious, you can't assign a value to a reference of a typed property of the wrong type. Since copying arrays and assigning instances to each member was how we detected references all I had to do was throw a try catch around it to stop it failing on every object with a typed property.
I didn't realize someone could throw a reference to a typed property into an array and pass that into kint (Even though that's basically what kint is doing itself...) so we basically had to do the same thing for arrays too.
Please confirm that this works @JPustkuchen
Example code
<?php
class test {
public int $v;
}
$t = new test();
$t->v = 4;
$a['val'] = &$t->v;
$a['val'] = 'test';
from kint.
Related Issues (20)
- Dynamic dump / print items in a array support HOT 7
- How to use a plugin? HOT 5
- kint.phar: continue2 or break? HOT 6
- PHP 8.1 issue - passing a null parameter HOT 6
- TypeError str_replace(): Argument #3 ($subject) must be of type array|string, bool givenexi HOT 2
- Some HTML errors HOT 2
- Psalm false-positives
- PHP Warning: realpath(): open_basedir restriction in effect
- Solarized-dark theme changes body text and background color HOT 5
- Simplexml parsing with PHP 8.2 and Apache and attribute leads to an segfault HOT 3
- SplFileInfoRepresentation: TypeError date(): Argument #2 ($timestamp) must be of type ?int, bool given HOT 3
- Phar build reproducability HOT 14
- file_exists(): Unable to find the wrapper "phar" HOT 10
- file_exists() throws exception when a NULL character exists in string HOT 4
- triple clicks marks the whole page
- Can't return plain text with modifiers HOT 2
- Fatal error: Uncaught Error: Class "Kint\Parser\Parser" not found
- Show dump time HOT 4
- Allow class in shallow_blacklist to display occurrences of same class in it's own dump HOT 2
- Symfony/Drupal: TypeError: Cannot assign stdClass to reference held by property of type array HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kint.