3v4l.org

run code in 300+ PHP versions simultaneously
<?php $interval = new DateInterval('PT1S'); $interval->f = -0.000001; var_dump($interval->s, $interval->f); echo "\n"; $interval = unserialize(serialize($interval)); var_dump($interval->s, $interval->f);
Output for 7.3.0 - 7.3.13, 7.4.0 - 7.4.1, 7.4.26 - 7.4.30, 8.0.13 - 8.0.23, 8.1.0 - 8.1.10
int(1) float(-1.0E-6) int(1) float(-1.0E-6)
Output for 7.3.14 - 7.3.33, 7.4.2 - 7.4.25, 8.0.0 - 8.0.12
int(1) float(-1.0E-6) int(1) int(-1)

preferences:
20.17 ms | 410 KiB | 5 Q