This is something I haven't seen before but it appears to be supported and it does work, referencing the returned array key directly after the providing function is called. BUT... is this good practice? Will this be supported in the future? Does this even have a name?
<?php
function example_function() {
$return = array('part_1', 'part_2');
return $return;
}
$var = example_function()[0];
echo $var;
To get the same result I would normally do the following
$var = example_function();
$var = $var[0];