3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $post_id = array((object) (array( 'post_id' => 140, )), (object) (array( 'post_id' => 141, )), (object) (array( 'post_id' => 142, ))); print_r($post_id); foreach ($post_id as $key => $value) { $result[] = $value->post_id; } print_r($result);
based on vCa10
Output for 5.6.0 - 7.3.0beta1
Array ( [0] => stdClass Object ( [post_id] => 140 ) [1] => stdClass Object ( [post_id] => 141 ) [2] => stdClass Object ( [post_id] => 142 ) ) Array ( [0] => 140 [1] => 141 [2] => 142 )