I need to be able to set my object like this:
$obj->foo = \'bar\';
then I need to use it as an array like that:
if($obj[\'f
You could also cast the object as an array:
if((array)$obj['foo'] == 'bar'){ //more code here }