Please refer to the migration guide
https://dev.twitch.tv/docs/v5/guides/migration
The following will convert you to V5
curl_setopt_array($mycurl, array(
CURLOPT_HTTPHEADER => array('Client-ID: '. $clientId, 'Accept': 'application/vnd.twitchtv.v5+json'),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_URL => $url));
And $stream_list needs to be a user_id not a user_name
Or you can rewrite the script completely to support New API: