1 | <?php |
||
9 | class DateTimeParser extends AbstractParser |
||
10 | { |
||
11 | /** @var null|string */ |
||
12 | private $format; |
||
13 | public function getFormat() { return $this->format; } |
||
15 | |||
16 | /** @var bool */ |
||
17 | private $ignoreWarnings; |
||
18 | public function getIgnoreWarnings() { return $this->ignoreWarnings; } |
||
20 | |||
21 | /** @var bool */ |
||
22 | private $immutable; |
||
23 | public function getImmutable() { return $this->immutable; } |
||
25 | |||
26 | /** |
||
27 | * DateTimeParser constructor. |
||
28 | * @param string|null $format |
||
29 | * @param bool $ignoreWarnings |
||
30 | * @param string $errorMessage |
||
31 | */ |
||
32 | public function __construct(string $format = null, bool $ignoreWarnings = false, string $errorMessage = "", bool $immutable = false) |
||
39 | |||
40 | /** |
||
41 | * @param mixed $rawValue |
||
42 | * @return \DateTime |
||
43 | * @throws ParsingException |
||
44 | */ |
||
45 | public function parse($rawValue) |
||
71 | } |
||
72 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: