3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $games = json_decode($data, true); $gamesnum = count($games['data']['games']['game']); $gamesnum = $gamesnum-1; $home_team = ''; $away_team = ''; for ($i=$gamesnum;$i>=0;$i--) { $home_name_abbrev[$i]= $games['data']['games']['game'][$i]['home_name_abbrev']; $hometeam[$i]= $games['data']['games']['game'][$i]['home_team_name']; $away_name_abbrev[$i]= $games['data']['games']['game'][$i]['away_name_abbrev']; $awayteam[$i]= $games['data']['games']['game'][$i]['away_team_name']; $status[$i] = $games['data']['games']['game'][$i]['status']; $etime[$i] = $games['data']['games']['game'][$i]['first_pitch_et']; $time = strtotime($etime[$i]); $startTime = date("h:i", strtotime('-30 minutes', $time)); $ampm[$i] = $games['data']['games']['game'][$i]['ampm']; $league[$i] = $games['data']['games']['game'][$i]['league']; }
based on MBOOJ
Output for 7.2.0
Notice: Undefined variable: data in /in/iOmoO on line 3 Warning: count(): Parameter must be an array or an object that implements Countable in /in/iOmoO on line 4
Output for 5.4.0 - 7.1.10
Notice: Undefined variable: data in /in/iOmoO on line 3