mirror of
https://github.com/php/php-src.git
synced 2026-03-24 16:22:37 +01:00
19 lines
503 B
PHP
19 lines
503 B
PHP
--TEST--
|
|
DateTime::modify() with empty string as format
|
|
--FILE--
|
|
<?php
|
|
|
|
$datetime = new DateTime;
|
|
var_dump(date_modify($datetime, ''));
|
|
try {
|
|
var_dump($datetime->modify(''));
|
|
} catch (DateMalformedStringException $e) {
|
|
echo $e::class, ': ', $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Warning: date_modify(): Failed to parse time string () at position 0 ( ): Empty string in %s
|
|
bool(false)
|
|
DateMalformedStringException: DateTime::modify(): Failed to parse time string () at position 0 ( ): Empty string
|