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

14 lines
378 B
PHP

--TEST--
Bug #70245 (strtotime does not emit warning when 2nd parameter is object or string)
--FILE--
<?php
$d = new DateTime('2011-01-15 00:00:00');
try {
var_dump(strtotime('-1 month', $d));
} catch (TypeError $e) {
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
TypeError: strtotime(): Argument #2 ($baseTimestamp) must be of type ?int, DateTime given