3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date1 = new DateTime('2015-01-01'); $date2 = new DateTime('2015-12-29'); $interval = $date2->diff($date1); $months = ($interval->y * 12) + $interval->m; $months += number_format($interval->d / 30, 2); echo $months; echo float(3.5793);
based on rOI4c
Output for 7.0.0 - 7.2.0
11.93 Fatal error: Uncaught Error: Call to undefined function float() in /in/3UXmZ:12 Stack trace: #0 {main} thrown in /in/3UXmZ on line 12
Process exited with code 255.
Output for 5.3.21 - 5.6.28
11.93 Fatal error: Call to undefined function float() in /in/3UXmZ on line 12
Process exited with code 255.