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 ); 17for($loop_counter = 0; $loop_counter < count($link_string); $loop_counter++) { 18 echo "-- Iteration"; 19 echo $loop_counter + 1; 20 echo " --\n"; 21 22 var_dump( readlink($link_string[$loop_counter]) ); 23 var_dump( realpath($link_string[$loop_counter]) ); 24} 25 26echo "Done\n"; 27?> 28--EXPECTF-- 29*** Testing readlink() and realpath() : usage variations *** 30 31*** Testing readlink() and realpath() with linkname as empty string, NULL and single space *** 32-- Iteration1 -- 33 34Warning: readlink(): %s in %s on line %d 35bool(false) 36%s 37-- Iteration2 -- 38 39Warning: readlink(): %s in %s on line %d 40bool(false) 41%s 42-- Iteration3 -- 43 44Warning: readlink(): %s in %s on line %d 45bool(false) 46string(%d) "%s" 47-- Iteration4 -- 48 49Warning: readlink(): %s in %s on line %d 50bool(false) 51string(%d) "%s" 52Done 53