1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/date/tests/DateTime_modify_invalid_format.phpt
2023-02-08 10:27:33 +00:00

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