3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $__item = new stdClass(); $__item->total = count($vars['items']); $__item->iteration = 0; $__item->index = -1; $__item->show=$__item->total > 0; print_r($__item); //$vars['foreach']['cycle'] = $__item; $_foreach_cycle = $__item; $_foreach_cycle->index = 0; print_r($__item);
Output for 5.0.4 - 5.6.28, hhvm-3.10.0, 7.0.0 - 7.1.0
Notice: Undefined variable: vars in /in/Aq8RI on line 3 stdClass Object ( [total] => 0 [iteration] => 0 [index] => -1 [show] => ) stdClass Object ( [total] => 0 [iteration] => 0 [index] => 0 [show] => )
Output for hhvm-3.12.0
Notice: Undefined variable: vars in /in/Aq8RI on line -1 stdClass Object ( [total] => 0 [iteration] => 0 [index] => -1 [show] => ) stdClass Object ( [total] => 0 [iteration] => 0 [index] => 0 [show] => )
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: vars in /in/Aq8RI on line 3 stdClass Object ( [total] => 0 [iteration] => 0 [index] => -1 [show] => ) stdClass Object ( [total] => 0 [iteration] => 0 [index] => 0 [show] => )
Output for 4.3.0 - 4.4.9
Notice: Undefined variable: vars in /in/Aq8RI on line 3 stdClass Object ( [total] => 0 [iteration] => 0 [index] => -1 [show] => ) stdClass Object ( [total] => 0 [iteration] => 0 [index] => -1 [show] => )