public function asArray()
    {
        $array = [];

        foreach ($this as $key => $val) {
            if ($val instanceof self) {
                $val = $val->asArray();
            }
            $array[$key] = $val;
        }

        return $array;
    }
public function asArray()
    {
        $array = [];

        foreach ($this as $key => $val) {
            if ($val instanceof self) {
                $val = $val->asArray();
            }
            $array[$key] = $val;
        }

        return $array;
    }
public function asArray ( ) { $ array = [ ] ; foreach ( $ this as $ key => $ val ) { if ( $ val instanceof self ) { $ val = $ val -> asArray ( ) ; } $ array [ $ key ] = $ val ; } return $ array ; }
Convert the current instance to a basic array.

@return array
Convert the current instance to a basic array .