Skip to content

Different results for to_h and to_hash on ENV #3162

@ghost

Description

Hi,

converting ENV to a Hash gives different results. It depends on which to_-method is used.

MRI

ENV.object_id
# => 17981260
ENV.to_h.object_id
# => 22183040
ENV.to_hash.object_id
# => 22148380

JRuby

ENV.object_id
# => 2042
ENV.to_h.object_id
# => 2042
ENV.to_hash.object_id
# => 2044

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions