Skip to content

Syntax error when using PHP 7.4, due to use of union type. #51

Closed
@farez

Description

@farez

Describe the bug

The union type float|int in the function definition of Filter::numberFilter() is flagged as a syntax error, when using PHP 7.4.

Union types are only valid in PHP8.0 and above, but PHP 7.4 is being supported in composer.json.

To Reproduce
Call Filter::numberFilter() while using PHP 7.4.

Expected behavior
There should not be a syntax error.

Exceptions
This works fine in PHP8.0. So maybe remove all use of union types or make PHP8.0 the minimum requirement?

Additional context
None.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions