<?php
namespace NS {
class C {
public $fn;
public function __construct() {
$this->fn = function (string $arg) {
var_dump("fn");
};
}
}
}
namespace {
$fn = (new NS\C)->fn;
$fn("null");
echo "Done\n";
}
Catchable fatal error: Argument 1 passed to NS\C::NS\{closure}() must be an instance of NS\string, string given, called in /in/6pNY6 on line 17 and defined in /in/6pNY6 on line 8
Process exited with code 255.