3v4l.org

run code in 200+ php & hhvm versions
<?php $purchases = array( array('product_id' => 7, 'receipt' => 'R13D13'), array('product_id' => 5, 'receipt' => 'Y28Z14'), array('product_id' => 7, 'receipt' => 'R02310'), array('product_id' => 5, 'receipt' => 'E11403') ); $arr = array_values(array_column($purchases, null, "product_id")); print_r($arr);
Output for 7.1.25 - 7.4.0beta2
Array ( [0] => Array ( [product_id] => 7 [receipt] => R02310 ) [1] => Array ( [product_id] => 5 [receipt] => E11403 ) )