Feature request
when constructing a UnionType we should check all inner types and remember whether it only contains of constant string types.
these constant string types could than be put into a trie datastructure so searching for another constant string type in isSuperTypeOf/isSubTypeOf can be a very fast operation (similar to how a high performance router component in a MVC framework would search a catalog of all system known routes against the current request uri)
the trie datastructure should be represented as a separate class. when possible the trie datastructure could also be used to represent big lists of enum cases to match against a EnumCaseObjectType.
maybe it would even work for big unions of constant integers (with a Trie? with a different datastructure?) ?
maybe we can even do it for any finite type
if one extra null or something like that is in the union it should not defeat the optimization
Did PHPStan help you today? Did it make you happy in any way?
No response
Feature request
when constructing a UnionType we should check all inner types and remember whether it only contains of constant string types.
these constant string types could than be put into a trie datastructure so searching for another constant string type in isSuperTypeOf/isSubTypeOf can be a very fast operation (similar to how a high performance router component in a MVC framework would search a catalog of all system known routes against the current request uri)
the trie datastructure should be represented as a separate class. when possible the trie datastructure could also be used to represent big lists of enum cases to match against a EnumCaseObjectType.
maybe it would even work for big unions of constant integers (with a Trie? with a different datastructure?) ?
maybe we can even do it for any finite type
if one extra
nullor something like that is in the union it should not defeat the optimizationDid PHPStan help you today? Did it make you happy in any way?
No response