3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $days = 60; echo '<pre>'; $day = date('d-m-Y H:i:s', (1444311162489/1000) + $days * 24 * 60 * 60); $expiration_date = new DateTime($day, new DateTimeZone('UTC')); $now = new DateTime('now', new DateTimeZone('UTC')); $is_expired = ($now > $expiration_date); $val = ($expiration_date->format('U') - $now->format('U')) / (60 * 60 * 24); $days = ceil($val); var_dump($val); if ($days > 60) { $days = 60; } var_dump($days);
based on g410c
Output for 5.6.28, 7.0.20 - 7.2.0
<pre>float(6.0134722222222) float(7)
Output for 5.5.0 - 5.6.23, 7.0.0 - 7.0.8
<pre>float(6.01375) float(7)