3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $term_ids_weirdstuff = array( 0 => array('tid' => 1), 1 => array('tid' => 2), 2 => array('tid' => 3), ); $term_ids=array(); foreach( $term_ids_weirdstuff as $dt)$term_ids[]=$dt['tid']; $dt[]=$val['tid']; print_r($term_ids); ?>
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: val in /in/eIu0K on line 11 Array ( [0] => 1 [1] => 2 [2] => 3 )
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: val in /in/eIu0K on line 11 Array ( [0] => 1 [1] => 2 [2] => 3 )