summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/fprintf_variation_004.phpt
blob: 103ca579f4e7afb72296a495cd8ef250cc3fdccd (plain)
ofshex dumpascii
0000 2d 2d 54 45 53 54 2d 2d 0a 54 65 73 74 20 66 70 72 69 6e 74 66 28 29 20 66 75 6e 63 74 69 6f 6e --TEST--.Test.fprintf().function
0020 20 28 76 61 72 69 61 74 69 6f 6e 20 2d 20 34 29 0a 2d 2d 46 49 4c 45 2d 2d 0a 3c 3f 70 68 70 0a .(variation.-.4).--FILE--.<?php.
0040 0a 24 63 68 61 72 5f 76 61 72 69 61 74 69 6f 6e 20 3d 20 61 72 72 61 79 28 20 27 61 27 2c 20 22 .$char_variation.=.array(.'a',."
0060 61 22 2c 20 36 37 2c 20 2d 36 37 2c 20 39 39 20 29 3b 0a 0a 2f 2a 20 63 72 65 61 74 69 6e 67 20 a",.67,.-67,.99.);../*.creating.
0080 64 75 6d 70 69 6e 67 20 66 69 6c 65 20 2a 2f 0a 24 64 61 74 61 5f 66 69 6c 65 20 3d 20 5f 5f 44 dumping.file.*/.$data_file.=.__D
00a0 49 52 5f 5f 20 2e 20 27 2f 66 70 72 69 6e 74 66 5f 76 61 72 69 61 74 69 6f 6e 5f 30 30 34 2e 74 IR__...'/fprintf_variation_004.t
00c0 78 74 27 3b 0a 69 66 20 28 21 28 24 66 70 20 3d 20 66 6f 70 65 6e 28 24 64 61 74 61 5f 66 69 6c xt';.if.(!($fp.=.fopen($data_fil
00e0 65 2c 20 27 77 74 27 29 29 29 0a 20 20 20 72 65 74 75 72 6e 3b 0a 0a 2f 2a 20 63 68 61 72 20 74 e,.'wt')))....return;../*.char.t
0100 79 70 65 20 76 61 72 69 61 74 69 6f 6e 73 20 2a 2f 0a 66 70 72 69 6e 74 66 28 24 66 70 2c 20 22 ype.variations.*/.fprintf($fp,."
0120 5c 6e 2a 2a 2a 20 54 65 73 74 69 6e 67 20 66 70 72 69 6e 74 66 28 29 20 66 6f 72 20 63 68 61 72 \n***.Testing.fprintf().for.char
0140 73 20 2a 2a 2a 5c 6e 22 29 3b 0a 66 6f 72 65 61 63 68 28 20 24 63 68 61 72 5f 76 61 72 69 61 74 s.***\n");.foreach(.$char_variat
0160 69 6f 6e 20 61 73 20 24 63 68 61 72 20 29 20 7b 0a 20 20 66 70 72 69 6e 74 66 28 20 24 66 70 2c ion.as.$char.).{...fprintf(.$fp,
0180 20 22 5c 6e 22 29 3b 0a 20 20 66 70 72 69 6e 74 66 28 20 24 66 70 2c 22 25 63 22 2c 20 24 63 68 ."\n");...fprintf(.$fp,"%c",.$ch
01a0 61 72 20 29 3b 0a 7d 0a 0a 66 63 6c 6f 73 65 28 24 66 70 29 3b 0a 0a 70 72 69 6e 74 5f 72 28 66 ar.);.}..fclose($fp);..print_r(f
01c0 69 6c 65 5f 67 65 74 5f 63 6f 6e 74 65 6e 74 73 28 24 64 61 74 61 5f 66 69 6c 65 29 29 3b 0a 65 ile_get_contents($data_file));.e
01e0 63 68 6f 20 22 5c 6e 44 6f 6e 65 22 3b 0a 0a 75 6e 6c 69 6e 6b 28 24 64 61 74 61 5f 66 69 6c 65 cho."\nDone";..unlink($data_file
0200 29 3b 0a 0a 3f 3e 0a 2d 2d 45 58 50 45 43 54 46 2d 2d 0a 2a 2a 2a 20 54 65 73 74 69 6e 67 20 66 );..?>.--EXPECTF--.***.Testing.f
0220 70 72 69 6e 74 66 28 29 20 66 6f 72 20 63 68 61 72 73 20 2a 2a 2a 0a 0a 00 0a 00 0a 43 0a 25 73 printf().for.chars.***......C.%s
0240 0a 63 0a 44 6f 6e 65 0a .c.Done.