@@ -29,7 +29,11 @@ mkdir($pname . '/oops');
29
29
file_put_contents ($ pname . '/foo/hi ' , '<?php
30
30
echo file_get_contents("foo/" . basename(__FILE__));
31
31
$context = stream_context_create();
32
- file_get_contents("./hi", 0, $context, 0, -1);
32
+ try {
33
+ file_get_contents("./hi", 0, $context, 0, -1);
34
+ } catch (ValueError $exception) {
35
+ echo $exception->getMessage() . "\n";
36
+ }
33
37
echo file_get_contents("fgc_edgecases.txt");
34
38
set_include_path(" ' . addslashes (__DIR__ ) . '");
35
39
echo file_get_contents("fgc_edgecases.txt", true);
53
57
<?php
54
58
echo file_get_contents ("foo/ " . basename (__FILE__ ));
55
59
$ context = stream_context_create ();
56
- file_get_contents ("./hi " , 0 , $ context , 0 , -1 );
60
+ try {
61
+ file_get_contents ("./hi " , 0 , $ context , 0 , -1 );
62
+ } catch (ValueError $ exception ) {
63
+ echo $ exception ->getMessage () . "\n" ;
64
+ }
57
65
echo file_get_contents ("fgc_edgecases.txt " );
58
66
set_include_path ("%stests " );
59
67
echo file_get_contents ("fgc_edgecases.txt " , true );
@@ -63,14 +71,17 @@ echo file_get_contents("./hi", 0, $context, 50000);
63
71
echo file_get_contents ("./hi " );
64
72
echo file_get_contents ("./hi " , 0 , $ context , 0 , 0 );
65
73
?>
66
-
67
- Warning: file_get_contents(): Length must be greater than or equal to zero in phar://%sfgc_edgecases.phar.php/foo/hi on line %d
74
+ file_get_contents(): Argument #5 ($maxlen) must be greater than or equal to 0
68
75
test
69
76
test
70
77
<?php
71
78
echo file_get_contents ("foo/ " . basename (__FILE__ ));
72
79
$ context = stream_context_create ();
73
- file_get_contents ("./hi " , 0 , $ context , 0 , -1 );
80
+ try {
81
+ file_get_contents ("./hi " , 0 , $ context , 0 , -1 );
82
+ } catch (ValueError $ exception ) {
83
+ echo $ exception ->getMessage () . "\n" ;
84
+ }
74
85
echo file_get_contents ("fgc_edgecases.txt " );
75
86
set_include_path ("%stests " );
76
87
echo file_get_contents ("fgc_edgecases.txt " , true );
@@ -87,7 +98,11 @@ Warning: file_get_contents(): Failed to seek to position 50000 in the stream in
87
98
<?php
88
99
echo file_get_contents ("foo/ " . basename (__FILE__ ));
89
100
$ context = stream_context_create ();
90
- file_get_contents ("./hi " , 0 , $ context , 0 , -1 );
101
+ try {
102
+ file_get_contents ("./hi " , 0 , $ context , 0 , -1 );
103
+ } catch (ValueError $ exception ) {
104
+ echo $ exception ->getMessage () . "\n" ;
105
+ }
91
106
echo file_get_contents ("fgc_edgecases.txt " );
92
107
set_include_path ("%stests " );
93
108
echo file_get_contents ("fgc_edgecases.txt " , true );
0 commit comments