Skip to content

Copy Trait documentation is incorrect #1

@shadowhand

Description

@shadowhand

The following statement is incorrect:

2nd - you have to make changed field public because when you clone $this and try to modify some field you don't have an access to private and protected fields anymore. Leaving those fields with such liberal property visibility may lead to a lot of troubles.

Cloning an object does not change its scope. Thus, modifying a clone inside of the parent is perfectly valid and possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions