1--TEST-- 2Test fprintf() function (variation - 3) 3--SKIPIF-- 4<?php 5if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); 6?> 7--FILE-- 8<?php 9 10$int_numbers = array( 0, 1, -1, 2.7, -2.7, 23333333, -23333333, "1234" ); 11 12/* creating dumping file */ 13$data_file = __DIR__ . '/fprintf_variation_003.txt'; 14if (!($fp = fopen($data_file, 'wt'))) 15 return; 16 17/* binary type variations */ 18fprintf($fp, "\n*** Testing fprintf() with binary ***\n"); 19foreach( $int_numbers as $bin_num ) { 20 fprintf( $fp, "\n"); 21 fprintf( $fp, "%b", $bin_num ); 22} 23 24fclose($fp); 25 26print_r(file_get_contents($data_file)); 27echo "\nDone"; 28 29unlink($data_file); 30 31?> 32--EXPECT-- 33*** Testing fprintf() with binary *** 34 350 361 3711111111111111111111111111111111 3810 3911111111111111111111111111111110 401011001000000100111010101 4111111110100110111111011000101011 4210011010010 43Done 44