Skip to content

Commit 0249e46

Browse files
[PropertyAccess] Fix access to undefined "file" key when checking stack frames
1 parent ffee082 commit 0249e46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PropertyAccessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ private function readProperty(array $zval, string $property, bool $ignoreInvalid
470470
[$trace] = $e->getTrace();
471471

472472
// handle uninitialized properties in PHP >= 7
473-
if (__FILE__ === $trace['file']
473+
if (__FILE__ === ($trace['file'] ?? null)
474474
&& $name === $trace['function']
475475
&& $object instanceof $trace['class']
476476
&& preg_match('/Return value (?:of .*::\w+\(\) )?must be of (?:the )?type (\w+), null returned$/', $e->getMessage(), $matches)

0 commit comments

Comments
 (0)