Describe the bug
When using destructuring syntax of PHP, the variables gets unset type.
To Reproduce
Please consider the following code
function get_some_array() : array {
return [
'123',
false,
'stuff',
];
}
[ $one, $two, $three ] = get_some_array();
// type of $one is unset ❌
// type of $two is unset ❌
// type of $three is unset ❌
$all = get_some_array();
$all_one = $all[0];
// type of $all_one is mixed ✅
Expected behavior
$one, $two and $three should have mixed type, not unset type.
Platform and version
Seems like this is not implemented in extension https://wiki.php.net/rfc/short_list_syntax#proposal
@KapitanOczywisty This is already implemented in PHP 7.1
@swashata I meant by extension
Most helpful comment
@swashata I meant by extension