Skip to content

Validator unhandeled MathException #55944

@mantas-done

Description

@mantas-done

Laravel Version

v12.14.1

PHP Version

8.4

Database Driver & Version

No response

Description

On specific input $validator->fails() throws exception instead of returning bool

Steps To Reproduce

Run this code and you will get an exception instead of var_dump output.
Illuminate\Support\Exceptions\MathException - Scientific notation exponent outside of allowed range.

$validator = \Validator::make([
        'amount' => '000542e-110880933569',
    ], [
        'amount' => 'numeric|between:0.9,10',
    ]);

    var_dump($validator->fails()); // throws MathException instead of returning boolean

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions