public static function autobox($value) {
        if (is_numeric($value)) {
            if (strpos($value, '.') !== false) {
                return (float) $value;

            } else {
                return (int) $value;
            }
        } else if (is_bool($value)) {
            return (bool) $value;

        } else if ($value === 'true' || $value === 'false') {
            return ($value === 'true');
        }

        return (string) $value;
    }
public static function autobox($value) {
        if (is_numeric($value)) {
            if (strpos($value, '.') !== false) {
                return (float) $value;

            } else {
                return (int) $value;
            }
        } else if (is_bool($value)) {
            return (bool) $value;

        } else if ($value === 'true' || $value === 'false') {
            return ($value === 'true');
        }

        return (string) $value;
    }
public static function autobox ( $ value ) { if ( is_numeric ( $ value ) ) { if ( strpos ( $ value , '.' ) !== false ) { return ( float ) $ value ; } else { return ( int ) $ value ; } } else if ( is_bool ( $ value ) ) { return ( bool ) $ value ; } else if ( $ value === 'true' || $ value === 'false' ) { return ( $ value === 'true' ) ; } return ( string ) $ value ; }
Autobox a value by type casting it.

@param mixed $value
@return mixed
Autobox a value by type casting it .