So this is an array of objects with properties listed?
Why aren't you just using mulitdimentional arrays?
$buildingblocks = Array (
'Alanine' => array (
'symbol' => 'ala',
'code' => 'A',
'type' => 'hydrophobic'
),
'Lysine' => array(
'symbol' => 'lys',
'code' => 'K',
'type' => 'charged'
)
);
foreach ($buildingblocks as $name => $info) {
if ($name == 'Lysine') {
echo $info['type'];
}
}