Skip to content

In :: multi cannot be used number as index in array #10

@pilec

Description

@pilec

this code run properly:

$m = Matcher::multi('//div[@id="siteTable"]/div[contains(@class, "thing")]', [
            'id' => '@data-fullname', //string as index
        ])->fromHtml();

        $f = file_get_contents('http://www.reddit.com/');

but if i try make these little change:

$m = Matcher::multi('//div[@id="siteTable"]/div[contains(@class, "thing")]', [
            1 => '@data-fullname', //number as index
        ])->fromHtml();

        $f = file_get_contents('http://www.reddit.com/');

        $extractedData = $m($f);

I`ve got error: Warning array_merge(): Argument #2 is not an array
File: .../vendor/atrox/matcher/Matcher.php:281

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions