Skip to content

ReflectionFunction::fromClosure does not work for first-class callables (throw NoClosureOnLine exception) #1363

Open
@MartinMystikJonas

Description

This code throws NoClosureOnLine exception

$closure = (new Something())->foo(...);
ReflectionFunction::createFromClosure($closure);

it seems ReflectionFunction::createFromClosure does not support first class callables. Is there any other way to get reflection of given closure created by first-class callable?

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