/hphp/test/zend/good/ext/standard/tests/strings/fprintf_variation_003_64bit.php
http://github.com/facebook/hiphop-php · PHP · 23 lines · 16 code · 5 blank · 2 comment · 1 complexity · f738f717808fab63b3aa075e5136d138 MD5 · raw file
- <?hh
- <<__EntryPoint>> function main(): void {
- $int_numbers = varray[ 0, 1, -1, 2.7, -2.7, 23333333, -23333333, "1234" ];
- /* creating dumping file */
- $data_file = dirname(__FILE__) . '/fprintf_variation_003_64bit.phpt.txt';
- if (!($fp = fopen($data_file, 'wt')))
- return;
- /* binary type variations */
- fprintf($fp, "\n*** Testing fprintf() with binary ***\n");
- foreach( $int_numbers as $bin_num ) {
- fprintf( $fp, "\n");
- fprintf( $fp, "%b", $bin_num );
- }
- fclose($fp);
- print_r(file_get_contents($data_file));
- echo "\nDone";
- unlink($data_file);
- }