PATH:
opt
/
alt
/
tests
/
alt-php55-pecl-igbinary_2.0.8-1.el8
/
tests
--TEST-- Check for double NaN, Inf, -Inf, 0, and -0. IEEE 754 doubles --FILE-- <?php function str2bin($bytestring) { $len = strlen($bytestring); $output = ''; for ($i = 0; $i < $len; $i++) { $bin = decbin(ord($bytestring[$i])); $bin = str_pad($bin, 8, '0', STR_PAD_LEFT); $output .= $bin; } return $output; } function test($type, $variable) { $serialized = igbinary_serialize($variable); $unserialized = igbinary_unserialize($serialized); echo $type, ":\n"; var_dump($variable); var_dump($unserialized); echo " 6 5 4 3 2 1\n"; echo "3210987654321098765432109876543210987654321098765432109876543210\n"; echo str2bin(substr($serialized, 5, 8)), "\n"; echo "\n"; } // exponent all-1, non zero mantissa test('double NaN', NAN); // sign 0, exp all-1, zero mantissa test('double Inf', INF); // sign 1, exp all-1, zero mantissa test('double -Inf', -INF); // sign 0, all-0 test('double 0.0', 0.0); // sign 1, all-0 test('double -0.0', -1 * 0.0); --EXPECTREGEX-- double NaN: float\(NAN\) float\(NAN\) 6 5 4 3 2 1 3210987654321098765432109876543210987654321098765432109876543210 .111111111110*1.* double Inf: float\(INF\) float\(INF\) 6 5 4 3 2 1 3210987654321098765432109876543210987654321098765432109876543210 0111111111110000000000000000000000000000000000000000000000000000 double -Inf: float\(-INF\) float\(-INF\) 6 5 4 3 2 1 3210987654321098765432109876543210987654321098765432109876543210 1111111111110000000000000000000000000000000000000000000000000000 double 0.0: float\(0\) float\(0\) 6 5 4 3 2 1 3210987654321098765432109876543210987654321098765432109876543210 0000000000000000000000000000000000000000000000000000000000000000 double -0.0: float\(-0\) float\(-0\) 6 5 4 3 2 1 3210987654321098765432109876543210987654321098765432109876543210 1000000000000000000000000000000000000000000000000000000000000000
[-] igbinary_015c.phpt
[edit]
[-] igbinary_043.phpt
[edit]
[-] igbinary_057.phpt
[edit]
[-] igbinary_bug72134.phpt
[edit]
[-] igbinary_045.phpt
[edit]
[-] igbinary_045b.phpt
[edit]
[-] igbinary_063.phpt
[edit]
[-] igbinary_069.phpt
[edit]
[-] igbinary_052.phpt
[edit]
[-] igbinary_004.phpt
[edit]
[-] igbinary_017.phpt
[edit]
[-] igbinary_053.phpt
[edit]
[-] igbinary_032.phpt
[edit]
[-] igbinary_058.phpt
[edit]
[-] igbinary_005.phpt
[edit]
[-] igbinary_046b.phpt
[edit]
[-] igbinary_063_php72.phpt
[edit]
[-] igbinary_064.phpt
[edit]
[-] igbinary_044.phpt
[edit]
[-] igbinary_033.phpt
[edit]
[-] igbinary_040.phpt
[edit]
[-] igbinary_046c.phpt
[edit]
[-] igbinary_049b.phpt
[edit]
[-] igbinary_006.phpt
[edit]
[-] igbinary_054.phpt
[edit]
[-] igbinary_063_php7.phpt
[edit]
[-] igbinary_046d.phpt
[edit]
[-] igbinary_046.phpt
[edit]
[-] igbinary_021.phpt
[edit]
[-] igbinary_034.phpt
[edit]
[-] igbinary_059.phpt
[edit]
[-] igbinary_068.phpt
[edit]
[-] igbinary_029.phpt
[edit]
[-] igbinary_014.phpt
[edit]
[-] igbinary_025.phpt
[edit]
[-] igbinary_016.phpt
[edit]
[-] igbinary_048b.phpt
[edit]
[-] igbinary_024.phpt
[edit]
[-] igbinary_055.phpt
[edit]
[-] igbinary_048.phpt
[edit]
[-] igbinary_009.phpt
[edit]
[-] igbinary_051.phpt
[edit]
[-] igbinary_023.phpt
[edit]
[-] igbinary_012.phpt
[edit]
[-] igbinary_030.phpt
[edit]
[-] igbinary_058b.phpt
[edit]
[-] igbinary_065.phpt
[edit]
[-] igbinary_018.phpt
[edit]
[-] igbinary_015.phpt
[edit]
[-] igbinary_030_php7.phpt
[edit]
[-] igbinary_062.phpt
[edit]
[-] igbinary_042.phpt
[edit]
[-] igbinary_026b.phpt
[edit]
[-] igbinary_002.phpt
[edit]
[-] igbinary_041.phpt
[edit]
[-] igbinary_031.phpt
[edit]
[-] igbinary_027.phpt
[edit]
[-] igbinary_020.phpt
[edit]
[-] igbinary_022.phpt
[edit]
[-] igbinary_030_php72.phpt
[edit]
[-] igbinary_015b.phpt
[edit]
[-] igbinary_007.phpt
[edit]
[-] igbinary_049.phpt
[edit]
[-] igbinary_050.phpt
[edit]
[+]
..
[-] igbinary_013.phpt
[edit]
[-] igbinary_010.phpt
[edit]
[-] igbinary_028.phpt
[edit]
[-] igbinary_045c.phpt
[edit]
[-] igbinary_001.phpt
[edit]
[-] igbinary_003.phpt
[edit]
[-] igbinary_066.phpt
[edit]
[-] igbinary_008.phpt
[edit]
[-] igbinary_009b.phpt
[edit]
[-] igbinary_026.phpt
[edit]
[-] igbinary_047.phpt
[edit]