Skip to content

strtotime not returning false for the wrong string #12393

@asmafarhat2006

Description

@asmafarhat2006

Description

The following code:

<?php

$trimmed = 'MONDAY 2, Tuesday 2,  Wednesday 3, Thursday 4, Friday 5';
var_dump(strtotime($trimmed));


$trimmed = 'Monday ,Tuesday , Wednesday';
var_dump(strtotime($trimmed));

For first var_dump returns false which is correct but for second var_dump returns the UNIX timestamp which is incorrect
It should return false when there are multiple days in week. which it does for the first example but doesnt for the 2nd.

Affects all PHP versions 7.4+

PHP Version

PHP 7.4+

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions