dis-bench / src /php /php-src /ext /date /tests /DateInterval_createFromDateString_broken.phpt
meddyrat's picture
Replace repository contents with the original corrected artifact
1e94262
Raw History Blame Contribute Delete
401 Bytes
--TEST--
Test DateInterval::createFromDateString() function : nonsense data
--FILE--
<?php
try {
$i = DateInterval::createFromDateString("foobar");
} catch (DateMalformedIntervalStringException $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
DateMalformedIntervalStringException: Unknown or bad format (foobar) at position 0 (f): The timezone could not be found in the database