1--TEST--
2Test vfprintf() function : error conditions (various conditions)
3--CREDITS--
4Felix De Vliegher <felix.devliegher@gmail.com>
5--INI--
6precision=14
7--FILE--
8<?php
9// Open handle
10$file = 'vfprintf_error4.txt';
11$fp = fopen( $file, "a+" );
12
13echo "\n-- Testing vfprintf() function with other strangeties  --\n";
14try {
15    var_dump( vfprintf( 'foo', 'bar', array( 'baz' ) ) );
16} catch (TypeError $e) {
17    echo $e->getMessage(), "\n";
18}
19try {
20    var_dump( vfprintf( $fp, 'Foo %$c-0202Sd', array( 2 ) ) );
21} catch(\ValueError $e) {
22    print('Error found: '.$e->getMessage().".\n");
23}
24// Close handle
25fclose( $fp );
26
27?>
28--CLEAN--
29<?php
30
31$file = 'vfprintf_error4.txt';
32unlink( $file );
33
34?>
35--EXPECT--
36-- Testing vfprintf() function with other strangeties  --
37vfprintf(): Argument #1 ($stream) must be of type resource, string given
38Error found: Argument number specifier must be greater than zero and less than 2147483647.
39