I was mistaken I thought that a print_r on an object would case it to a string if it has a __toString() method - but apparently not. So what you have done here makes sense