@@ -4,49 +4,34 @@ Test readlink() and realpath() functions: usage variation - invalid args
4
4
<?php
5
5
echo "*** Testing readlink() and realpath() : usage variations *** \n" ;
6
6
7
- echo "\n*** Testing readlink() and realpath() with linkname as empty string, NULL and single space *** \n" ;
8
- $ link_string = array (
9
- /* linkname as spaces */
10
- " " ,
11
- ' ' ,
7
+ echo "\n*** Testing readlink() and realpath() with link name as empty string, NULL and single space *** \n" ;
12
8
13
- /* empty linkname */
14
- "" ,
15
- '' ,
16
- );
17
- for ($ loop_counter = 0 ; $ loop_counter < count ($ link_string ); $ loop_counter ++) {
18
- echo "-- Iteration " ;
19
- echo $ loop_counter + 1 ;
20
- echo " -- \n" ;
9
+ echo 'readlink with link as spaces ' , PHP_EOL ;
10
+ var_dump (readlink (' ' ));
11
+ echo 'realpath with link as spaces ' , PHP_EOL ;
12
+ var_dump (realpath (' ' ));
21
13
22
- var_dump ( readlink ($ link_string [$ loop_counter ]) );
23
- var_dump ( realpath ($ link_string [$ loop_counter ]) );
24
- }
14
+ echo 'readlink with link as empty string ' , PHP_EOL ;
15
+ var_dump (readlink ('' ));
16
+ echo 'realpath with link as empty string ' , PHP_EOL ;
17
+ var_dump (realpath ('' ));
25
18
26
19
echo "Done \n" ;
27
20
?>
28
21
--EXPECTF--
29
22
*** Testing readlink() and realpath() : usage variations ***
30
23
31
- *** Testing readlink() and realpath() with linkname as empty string, NULL and single space ***
32
- -- Iteration1 --
24
+ *** Testing readlink() and realpath() with link name as empty string, NULL and single space ***
25
+ readlink with link as spaces
33
26
34
27
Warning: readlink(): %s in %s on line %d
35
28
bool(false)
36
- %s
37
- -- Iteration2 --
38
-
39
- Warning: readlink(): %s in %s on line %d
40
- bool(false)
41
- %s
42
- -- Iteration3 --
43
-
44
- Warning: readlink(): %s in %s on line %d
29
+ realpath with link as spaces
45
30
bool(false)
46
- string(%d) "%s"
47
- -- Iteration4 --
31
+ readlink with link as empty string
48
32
49
33
Warning: readlink(): %s in %s on line %d
50
34
bool(false)
35
+ realpath with link as empty string
51
36
string(%d) "%s"
52
37
Done
0 commit comments