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($arraykey as $ad) { $temp = 0; if(strtotime($ad->date) > now()) { $temp = $page_views; } $total = $temp + $temp; } echo $total;
Output for 7.0.0 - 7.1.0
Notice: Trying to get property of non-object in /in/cGgHO on line 18 Fatal error: Uncaught Error: Call to undefined function now() in /in/cGgHO:18 Stack trace: #0 {main} thrown in /in/cGgHO on line 18
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Notice: Cannot access property on non-object in /in/cGgHO on line 18 Fatal error: Call to undefined function now() in /in/cGgHO on line 18
Process exited with code 255.
Output for 5.1.0 - 5.6.28
Notice: Trying to get property of non-object in /in/cGgHO on line 18 Fatal error: Call to undefined function now() in /in/cGgHO on line 18
Process exited with code 255.
Output for 5.0.1 - 5.0.5
Notice: Trying to get property of non-object in /in/cGgHO on line 18 Warning: strtotime(): Called with an empty time parameter. in /in/cGgHO on line 18 Fatal error: Call to undefined function now() in /in/cGgHO on line 18
Process exited with code 255.
Output for 5.0.0
Notice: Trying to get property of non-object in /in/cGgHO on line 18 Notice: strtotime(): Called with empty time parameter in /in/cGgHO on line 18 Fatal error: Call to undefined function now() in /in/cGgHO on line 18
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Notice: strtotime(): Called with empty time parameter in /in/cGgHO on line 18 Fatal error: Call to undefined function: now() in /in/cGgHO on line 18
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Notice: strtotime(): Called with empty time parameter in /in/cGgHO on line 18 Fatal error: Call to undefined function: now() in /in/cGgHO on line 18
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: strtotime() [http://www.php.net/function.strtotime]: Called with empty time parameter in /in/cGgHO on line 18 Fatal error: Call to undefined function: now() in /in/cGgHO on line 18