1--TEST--
2Test fprintf() function (variation - 6)
3--SKIPIF--
4<?php
5$data_file = dirname(__FILE__) . '/dump.txt';
6if (!($fp = fopen($data_file, 'w'))) {
7  die('skip File dump.txt could not be created');
8}
9if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
10?>
11--FILE--
12<?php
13
14$int_numbers = array( 0, 1, -1, 2.7, -2.7, 23333333, -23333333, "1234" );
15
16/* creating dumping file */
17$data_file = dirname(__FILE__) . '/dump.txt';
18if (!($fp = fopen($data_file, 'wt')))
19   return;
20
21/* unsigned int type variation */
22fprintf($fp, "\n*** Testing fprintf() for unsigned integers ***\n");
23foreach( $int_numbers as $unsig_num ) {
24  fprintf( $fp, "\n");
25  fprintf( $fp, "%u", $unsig_num );
26}
27
28fclose($fp);
29
30print_r(file_get_contents($data_file));
31echo "\nDone";
32
33unlink($data_file);
34
35?>
36--EXPECT--
37*** Testing fprintf() for unsigned integers ***
38
390
401
414294967295
422
434294967294
4423333333
454271633963
461234
47Done
48