Почему повторный вызов функции может вызывать ошибку?
function getCurrentShowArr($slug) {
require_once('some_api.php');
$allShows = SomeApi::get("/catalog/theaters/networks/kinocentr/shows/all-long.phps")['shows']['show'];
function showId($arr, $sl) {
$i=0;
do
$arr[$i]['alias'] == $sl ? $res = $arr[$i]['id']: '';
while(++$i<count($arr));
return $res;
};
$id = showId($allShows, $slug);
$data = SomeApi::get("/catalog/theaters/networks/kinocentr/shows/{$id}.phps");
$show = $data['show'];
return $show;
}
$film1 = getCurrentShowArr('star-wars-7');
$film2 = getCurrentShowArr('terminator');
Сообщение об ошибке:
[06-Jan-2016 16:58:01 UTC] PHP Fatal error: Cannot redeclare showId() (previously declared in home/domen/public_html/site/wp-content/themes/themename/functions.php:126) in home/domen/public_html/site/wp-content/themes/themename/functions.php on line 126