It would be nice to have a way to add short-lived tag information within a function, optionally addable via phpdoc (param/return)
This may be too slow to add to regular types.
add tag:array-key=>int, tag:array-key=>string, but with a more efficient representation (bit flag?)
If exactly one of these is seen, then assume the array key is an int, and make that affect foreach, key, array_keys
non-arrays shouldn't affect that?
Warn if the tags exist and don't match expected tags.
Erase it if the union type is merged with something lacking the tag
Other possibilities would be tag:array-shape => [0 => 'T1', 1 => 'int'] (can't be bit flag)
It would be nice to have a way to add short-lived tag information within a function, optionally addable via phpdoc (param/return)
add
tag:array-key=>int
,tag:array-key=>string
, but with a more efficient representation (bit flag?) If exactly one of these is seen, then assume the array key is an int, and make that affectforeach
,key
,array_keys
non-arrays shouldn't affect that?
Warn if the tags exist and don't match expected tags.
Erase it if the union type is merged with something lacking the tag
Other possibilities would be
tag:array-shape => [0 => 'T1', 1 => 'int']
(can't be bit flag)