class MyClass
{
private $mything = ['gaga'];
/** @test */
public function mytest(){
$rv = array_map(static function($record ) { return $this->mything;}, ['a', 'b']);
}
class MyClass
{
private $mything = ['gaga'];
public function mytest(){
$rv = array_map(static fn($record ) => $this->mything, ['a', 'b']);
}
both is wrong php code since you have no access to $this inside of static closures (static closures are, supposedly, a bit faster https://github.com/Ocramius/GeneratedHydrator/releases/tag/3.0.0 )
https://psalm.dev/r/6414bd28cf