3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arraykey = new stdClass; $arraykey->date = "2008-05-20"; $arraykey->page_views = 1; $arraykey->date = "2011-08-03"; $arraykey->page_views = 2; $arraykey->date = "2008-08-20"; $arraykey->page_views = 3; $arraykey->date = "2008-08-27"; $arraykey->page_views = 2; $arraykey->date = "2011-10-11"; $arraykey->page_views = 3; foreach($arr_date as $ad) { $temp = 0; if(strtotime($ad->date) > now()) { $temp = $page_views; } $total = $temp + $temp; } echo $total;
Output for 5.1.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: arr_date in /in/7lTni on line 15 Warning: Invalid argument supplied for foreach() in /in/7lTni on line 15 Notice: Undefined variable: total in /in/7lTni on line 24
Output for hhvm-3.10.0 - 3.13.2
Notice: Undefined variable: arr_date in /in/7lTni on line 23 Warning: Invalid argument supplied for foreach() in /in/7lTni on line 23 Notice: Undefined variable: total in /in/7lTni on line 24
Output for 5.0.4 - 5.0.5
Warning: Invalid argument supplied for foreach() in /in/7lTni on line 15 Notice: Undefined variable: total in /in/7lTni on line 24
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.0.3
Warning: Invalid argument supplied for foreach() in /in/7lTni on line 15 Notice: Undefined variable: total in /in/7lTni on line 24
Output for 4.3.11
Notice: Undefined variable: total in /in/7lTni on line 24