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

Appearance settings

[PropertyAccess][VarExporter] PropertyAccessor::isReadable() triggers an error when called on a lazy object’s missing property #51919

Copy link
Copy link
Closed
@MatTheCat

Description

@MatTheCat
Issue body actions

Symfony version(s) affected

≥ 6.2

Description

Calling PropertyAccessor::isReadable() on a lazy object’s missing property will trigger an error, even if the object is fully loaded.

This is because PropertyAccessor::getReadInfo() will return the property as public as its class has a __get method, and trying to access it will call trigger_error:

trigger_error(sprintf('Undefined property: %s::$%s in %s on line %s', $this::class, $name, $frame['file'], $frame['line']), \E_USER_NOTICE);

How to reproduce

Call PropertyAccessor::isReadable() on a lazy object’s (like a Doctrine proxy) missing property. Instead of false, you’ll get an ErrorException.

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.