1--TEST--
2Test readlink() and realpath() functions: usage variation - invalid args
3--FILE--
4<?php
5echo "*** Testing readlink() and realpath() : usage variations ***\n";
6
7echo "\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  ' ',
12
13  /* empty linkname */
14  "",
15  '',
16  NULL,
17  null
18 );
19for($loop_counter = 0; $loop_counter < count($link_string); $loop_counter++) {
20  echo "-- Iteration";
21  echo $loop_counter + 1;
22  echo " --\n";
23
24  var_dump( readlink($link_string[$loop_counter]) );
25  var_dump( realpath($link_string[$loop_counter]) );
26}
27
28echo "Done\n";
29?>
30--EXPECTF--
31*** Testing readlink() and realpath() : usage variations ***
32
33*** Testing readlink() and realpath() with linkname as empty string, NULL and single space ***
34-- Iteration1 --
35
36Warning: readlink(): %s in %s on line %d
37bool(false)
38%s
39-- Iteration2 --
40
41Warning: readlink(): %s in %s on line %d
42bool(false)
43%s
44-- Iteration3 --
45
46Warning: readlink(): %s in %s on line %d
47bool(false)
48string(%d) "%s"
49-- Iteration4 --
50
51Warning: readlink(): %s in %s on line %d
52bool(false)
53string(%d) "%s"
54-- Iteration5 --
55
56Warning: readlink(): %s in %s on line %d
57bool(false)
58string(%d) "%s"
59-- Iteration6 --
60
61Warning: readlink(): %s in %s on line %d
62bool(false)
63string(%d) "%s"
64Done
65