/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/date/tests/bug79015.phpt
31 строка
639 B
Gina Peter Banyard
core: Warn when non-representable floats are coerced to int (#19760)
22 сен 2025, 01:53
Не верифицирован
22 сен 2025, 01:53
b4ed215
Код
Авторство
О чём код?
--TEST-- Bug #79015 (undefined-behavior in php_date.c) --FILE-- <?php $payload = 'O:12:"DateInterval":9:{s:1:"y";i:1;s:1:"m";i:0;s:1:"d";i:4;s:1:"h";i:0;s:1:"i";i:0;s:1:"s";i:0;s:1:"f";i:9999999999990;s:6:"invert";i:0;s:4:"days";b:0;}'; var_dump(unserialize($payload)); ?> --EXPECTF-- Warning: The float 9.99999999999E+18 is not representable as an int, cast occurred in %s on line %d object(DateInterval)#%d (%d) { ["y"]=> int(1) ["m"]=> int(0) ["d"]=> int(4) ["h"]=> int(0) ["i"]=> int(0) ["s"]=> int(0) ["f"]=> float(%f) ["invert"]=> int(0) ["days"]=> bool(false) ["from_string"]=> bool(false) }