PHP supports the list()
language construct which, in short, allows you to return multiple values from a function and then attach them to different variable, eg:
function myBigReturn(){
return array("foo", "bar");
}
list($fooer, $barer) = myBigReturn();
echo $fooer; // echoes "foo"
echo $barer; // echoes "bar"
I have failed to find much info about such a language construct and I am curious - is usage of PHP list()
construct considered a bad coding convention? Are there any serious articles/literature on this subject?