I\'ve got an array of cats objects:
$cats = Array ( [0] => stdClass Object ( [id] => 15 ),
Warning create_function() has been DEPRECATED as of PHP 7.2.0. Relying on this function is highly discouraged.
create_function()
You can use the array_map() function. This should do it:
$catIds = array_map(create_function('$o', 'return $o->id;'), $objects);