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 - 7.3.1
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 - 5.6.38, hhvm-3.10.1, hhvm-3.20.2 - 3.21.3, 7.0.0 - 7.1.25
Notice: Undefined variable: data in /in/iOmoO on line 3
Output for hhvm-3.22.0
Notice: Undefined variable: data in /in/iOmoO on line -1
Output for hhvm-3.11.1 - 3.19.2
Notice: Undefined variable: data in /in/iOmoO on line 3 Warning: json_decode() expects parameter 1 to be string, null given in /in/iOmoO on line 3