Just had to write a little bit of code I thought I'd share with you.
I've found myself having to convert an array to object with PHP quite a lot recently, and I've been writing it from scratch every time. Well here it is. This little function converts an array to a stdClass object by looping through the values.
Check it out and let me know what you think in the comments.
PHP Code:
<?php
class Helper_ArrayToObject {
    public static function convert($array) {
        if(!is_array($array)) {
            return $array;
        }
        $obj = new stdClass();
        foreach ($array as $key => $val) {
            if (is_array($val)) {
                $val = self::convert($val);
            }
            $obj->$key = $val;
        }
        return $obj;
    }
}

Michael commented on Sep 15th 2012
Arrays and Objects are easily type casted using PHP.