Skip to content

А function to get the string representation of the closure and array

License

Notifications You must be signed in to change notification settings

bermudaphp/var-export

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Install

composer require bermudaphp/var-export

Usage

$closure = static function (string $filename) use ($fileReader): string {
    return $fileReader->read($filename);
});

dd(export_closure($closure));

^ """
static function(string $filename) use($fileReader): string {
    return $fileReader->read($filename);
}

$closure = static fn(): string => __FILE__ ;

dd(export_closure($closure));

^ "static fn(): string => 'path/to/closure/filename'"

class A {
    public function call()
    {
        $closure = fn(): string => self::class ;
        dd(export_closure($closure));
    }
}

^ "fn(): string => \A::class"

About

А function to get the string representation of the closure and array

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages