PHP DateTime对象的diff()方法导致浮点变量出现问题

PHP v 5.3.5

I am having an issue where DateTime->diff seems to be mucking around with variables (which are type float) that it has no business touching. I'm obviously not understanding some way the object works (new to PHP OOP) or variable reference in general. Here's the code, and then I'll explain the output and what's weird.

$interval_in_seconds = $settings['interval'] * 86400;
$checkin_in_seconds = floor($checkin['timestamp'] / 1000);
$next_checkin = $checkin_in_seconds + $interval_in_seconds;
$until_next = $next_checkin - time();

if($until_next > 0) {
    $days = floor($until_next / 86400);

    function secondsToTime($seconds) {
        // Only here for var_dump testing:
        global $settings, $interval_in_seconds, $until_next, $next_checkin;

        $dtF = new DateTime("@0");
        $dtT = new DateTime("@$seconds");

var_dump($until_next);
        $return = $dtF->diff($dtT)->format('%h hours, %i minutes and %s seconds');
var_dump($until_next);

        return $return;
    }
    $countdown = $days . ' days, ' . secondsToTime($until_next);
}

$settings['interval'] is equal to 12 and is a float. $checkin['timestamp'] is 1413926734544 and a string (came from JS, hence the milliseconds)

Most of the time, but not all, $settings['interval'] or any of the other variables that I'm pulling in for debugging with global will display the correct value for the first var_dump() but a random character for the second one after the $dtF->diff($dtT)

Usually that character is < or ~, but I've also gotten 0 or one of the ascii crosses. I think that is dependent on which variable I'm dumping.

Example output for $settings['interval']

float(12) float(<)

The value returned from that function is correct and works as excepted, however, one of my other variables is getting taken into a dark alley and beaten up. I cannot figure out why. None of those variables are being manipulated, nothing (seems) to be passed by reference, and this was the case even before I used global

What's going on here?