Hi there! I saw a couple of issues related to this: #2826 and #1016. My issue seems to be slightly different though - it happens when a property on a stdClass object is accessed more than once, and it only seems to happen with results from PDO:
<?php
$db = new PDO('');
$q = $db->prepare('');
$q->execute();
$o = $q->fetch(PDO::FETCH_OBJ);
$o && ($o->p || $o->p); // Uncaught InvalidArgumentException: Could not get class storage for stdclass
Here's the failing case on psalm.dev: https://psalm.dev/r/816787d4b3
Here's a passing case with only one $o->p access: https://psalm.dev/r/1918607874
Here's a similar chunk of code using a plain stdClass constructor: https://psalm.dev/r/0d6d9aae0a
Hi there! I saw a couple of issues related to this: #2826 and #1016. My issue seems to be slightly different though - it happens when a property on a stdClass object is accessed more than once, and it only seems to happen with results from PDO:
Here's the failing case on psalm.dev: https://psalm.dev/r/816787d4b3
Here's a passing case with only one
$o->paccess: https://psalm.dev/r/1918607874Here's a similar chunk of code using a plain
stdClassconstructor: https://psalm.dev/r/0d6d9aae0a