Skip to content

Error when value is a string representation of a number #2

@dkeetonx

Description

@dkeetonx

The problem occurs when the value is_numeric but is also a string.

Steps to recreate:

$template =  Codewithkyrian\Jinja\Template('{{ test }}');
$template->render([ 'test' => '60' ]);

Result:

Codewithkyrian\Jinja\Runtime\NumericValue::__construct(): Argument #1 ($value) must be of type int|float, string given, called in vendor\codewithkyrian\jinja-php\src\Core\Environment.php on line 161.

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