/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/date/tests/bug70245.phpt
13 строк
378 B
Derick Rethans
Implement More Appropriate Date/Time Exceptions RFC
08 фев 2023, 13:27
08 фев 2023, 13:27
b7860cd
Код
Авторство
О чём код?
--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