true, because all non-empty strings are strings * * `string` matches `non-empty-string` * —> false, because a string is not necessarily non-empty * * `list` matches `array` * —> true, because a list is an array *and* strings are scalars * * `array` matches `list` * —> false, because an array is not necessarily a list */ public function matches(self $other): bool; /** * Infers the generics of this type from the given type. If no generics can * be inferred, the given generics are returned as-is. * * `array` inferred from `array` * —> T = string * * `array{foo: T, bar: int}` inferred from `array{foo: string, bar: int}` * —> T = string * * `T|string` inferred from `positive-int|non-empty-string` * —> T = positive-int */ public function inferGenericsFrom(Type $other, Generics $generics): Generics; public function nativeType(): Type; public function toString(): string; }