Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[DomCrawler] Cloned Crawler objects not usable because of overwritten getHash method #16421

Closed
@wasinger

Description

@wasinger

Since 2.8, DomCrawler overrides the SplStorage method "getHash($object)" for the purpose of displaying a deprecation message.

When a Crawler object is cloned this triggers PHP Bug #67582 Cloned SplObjectStorage with overwritten getHash fails offsetExists() and makes the cloned Crawler instance not working correctly (e.g. it's not possible to remove elements from them because methods detach() and removeAll() don't work).

Removing elements from cloned Crawler instances was not a problem up to Symfony 2.7. It's a regression that breaks some of my projects.

The problem was introduced in commit 997c650

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions