3v4l.org

run code in 300+ PHP versions simultaneously
<?php $expdate = '2017-07-01'; $currentDateTime = new \DateTime(date('Y-m-d')); $polExpDateTime = new \DateTime($expdate); var_dump($currentDateTime); var_dump($polExpDateTime); $delta = $currentDateTime->diff($polExpDateTime); var_dump($delta); echo $delta->days;

preferences:
43.17 ms | 402 KiB | 5 Q