Get a list of all the blocks I need an array of all blocks in the site

For example, if I display the array, it should output the block info or block titles e.g Search, User etc
Try this piece of code from a similar question

global $theme;
$all_regions = system_region_list($theme);
$blocks = array();
foreach (array_keys($all_regions) as $region) {
  $blocks += block_list($region);
}