Annotation of embedaddon/php/ext/standard/tests/strings/vfprintf_error4.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test vfprintf() function : error conditions (various conditions)
! 3: --CREDITS--
! 4: Felix De Vliegher <felix.devliegher@gmail.com>
! 5: --INI--
! 6: precision=14
! 7: --FILE--
! 8: <?php
! 9: /* Prototype : int vfprintf(resource stream, string format, array args)
! 10: * Description: Output a formatted string into a stream
! 11: * Source code: ext/standard/formatted_print.c
! 12: * Alias to functions:
! 13: */
! 14:
! 15: // Open handle
! 16: $file = 'vfprintf_test.txt';
! 17: $fp = fopen( $file, "a+" );
! 18:
! 19: echo "\n-- Testing vfprintf() function with other strangeties --\n";
! 20: var_dump( vfprintf( 'foo', 'bar', array( 'baz' ) ) );
! 21: var_dump( vfprintf( $fp, 'Foo %$c-0202Sd', array( 2 ) ) );
! 22:
! 23: // Close handle
! 24: fclose( $fp );
! 25:
! 26: ?>
! 27: ===DONE===
! 28: --CLEAN--
! 29: <?php
! 30:
! 31: $file = 'vfprintf_test.txt';
! 32: unlink( $file );
! 33:
! 34: ?>
! 35: --EXPECTF--
! 36: -- Testing vfprintf() function with other strangeties --
! 37:
! 38: Warning: vfprintf() expects parameter 1 to be resource, string given in %s on line %d
! 39: bool(false)
! 40:
! 41: Warning: vfprintf(): Argument number must be greater than zero in %s on line %d
! 42: bool(false)
! 43: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>