3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $RET = array ( '' => array ( 1 => array ( 'STAFF_ID' => '5038', ), 2 => array ( 'STAFF_ID' => '5039', ), 3 => array ( 'STAFF_ID' => '5046', ), 4 => array ( 'STAFF_ID' => '5066', ), 5 => array ( 'STAFF_ID' => '5062', ), 6 => array ( 'STAFF_ID' => '5074', ), 7 => array ( 'STAFF_ID' => '5073', ), 8 => array ( 'STAFF_ID' => '5056', ), 9 => array ( 'STAFF_ID' => '5059', ), 10 => array ( 'STAFF_ID' => '5061', ), 11 => array ( 'STAFF_ID' => '5080', ), 12 => array ( 'STAFF_ID' => '5755', ), 13 => array ( 'STAFF_ID' => '5082', ), 14 => array ( 'STAFF_ID' => '5087', ), 15 => array ( 'STAFF_ID' => '5085', ), 16 => array ( 'STAFF_ID' => '5727', ), 17 => array ( 'STAFF_ID' => '5050', ), 18 => array ( 'STAFF_ID' => '5081', ), 19 => array ( 'STAFF_ID' => '5045', ), 20 => array ( 'STAFF_ID' => '5758', ), 21 => array ( 'STAFF_ID' => '5728', ), 22 => array ( 'STAFF_ID' => '5063', ), 23 => array ( 'STAFF_ID' => '5083', ), 24 => array ( 'STAFF_ID' => '5040', ), 25 => array ( 'STAFF_ID' => '5077', ), 26 => array ( 'STAFF_ID' => '5051', ), 27 => array ( 'STAFF_ID' => '5060', ), 28 => array ( 'STAFF_ID' => '5058', ), 29 => array ( 'STAFF_ID' => '5069', ), 30 => array ( 'STAFF_ID' => '5075', ), 31 => array ( 'STAFF_ID' => '5055', ), 32 => array ( 'STAFF_ID' => '5048', ), 33 => array ( 'STAFF_ID' => '5067', ), 34 => array ( 'STAFF_ID' => '5043', ), 35 => array ( 'STAFF_ID' => '5064', ), 36 => array ( 'STAFF_ID' => '5078', ), 37 => array ( 'STAFF_ID' => '5729', ), 38 => array ( 'STAFF_ID' => '5068', ), 39 => array ( 'STAFF_ID' => '5079', ), 40 => array ( 'STAFF_ID' => '5054', ), 41 => array ( 'STAFF_ID' => '5088', ), 42 => array ( 'STAFF_ID' => '5076', ), ), ); $RET = array_shift($RET); $staffIds = array(); foreach ($RET as $k => $v) { if (isset($v['STAFF_ID'])) { $staffIds = $v['STAFF_ID']; } } var_dump($staffIds);
based on TcQSn
Output for 4.3.0 - 7.1.7, 7.2.0
string(4) "5076"
Output for 7.1.10

Process exited with code 137.