3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $list = array( array( 'order_cart_id' => 1, ), array( 'order_cart_id' => 2, ), array( 'order_cart_id' => 3, ), array( 'order_cart_id' => 4, ), ); $carts = array(); foreach($list as $i => $item) { if(!empty($item['order_cart_id'])) { $carts[$i] = (int) $item['order_cart_id']; } }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0