Skip to content

Php::Value::numericValue() does not play well with references #293

Description

@sjinks
static void swap(Php::Parameters& params)
{
    Php::Value temp = params[0];
    params[0] = params[1];
    params[1] = temp;
    std::cout << params[0].numericValue() << ' ' << params[1].numericValue() << ' ' << std::endl;
}

/// ...

e.add<swap>("swap", {
    Php::ByRef("a", Php::Type::Numeric),
    Php::ByRef("b", Php::Type::Numeric)
});

This will print weird values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions