I'm guessing the issue here is from, what I can remember, bad coding style learned during the VB/BASIC days, where you would say, "Hey I need to dynamicaly use some variable.. Well lets just create what we want:, ie:
PHP Code:
$my_hey = "this is hey";
$my_yo = "this is yo";
function give_me($decide){
return ${"my_$decide"};
}
Which could easily be changed to:
PHP Code:
$myArray = array(
"hey" => "this is hey",
"Yo" => "this is Yo");
function give_me($decide){
return $myArray[$decide];
}
For whatever reason I frequently see old BASIC programmers using loops with referencing variables like that, where they just append the current index to teh variable name, instead of just looping through an array..
For readability, and maintainability, I would rather have it in an array where the code is kinda self explaining, instead of some giberish someone would have to rewrite 5 years from now, because it's just poor programming style.