Skip to content

Support for Closures #38

Open
Open
@adamjimenez

Description

@adamjimenez

This valid code (from http://php.net/manual/en/functions.anonymous.php):

function ($quantity, $product) use ($tax, &$total)
{
    $pricePerItem = constant(__CLASS__ . "::PRICE_" .
        strtoupper($product));
    $total += ($pricePerItem * $quantity) * ($tax + 1.0);
}; 

Gives this error:

Parse error: syntax error, unexpected T_STRING, expecting identifier in /console.htm on line 2

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