--TEST-- Test tempnam() function: usage variations - test prefix maximum size --SKIPIF-- --FILE-- $prefix) { echo "-- Iteration $i --\n"; try { $file_name = tempnam("$file_path", $prefix); } catch (Error $e) { echo $e->getMessage(), "\n"; continue; } $base_name = basename($file_name); echo "File name is => ", $base_name, "\n"; echo "File name length is => ", strlen($base_name), "\n"; if (file_exists($file_name)) { unlink($file_name); } } rmdir($file_path); ?> --CLEAN-- --EXPECTF-- *** Testing tempnam() maximum prefix size *** -- Iteration 0 -- File name is => begin_%rx{7}%r_end%r.{19}%r File name length is => 36 -- Iteration 1 -- File name is => begin_%rx{53}%r_end%r.{19}%r File name length is => 82 -- Iteration 2 -- File name is => begin_%rx{54}%r_en%r.{19}%r File name length is => 82 -- Iteration 3 -- File name is => begin_%rx{55}%r_e%r.{19}%r File name length is => 82 -- Iteration 4 -- File name is => begin_%rx{57}%r%r.{19}%r File name length is => 82