1--TEST-- 2Test dirname() function : usage variations 3--SKIPIF-- 4<?php 5if((substr(PHP_OS, 0, 3) == "WIN")) 6 die('skip not for Windows'); 7?> 8--FILE-- 9<?php 10for ($i=0 ; $i<5 ; $i++) { 11 try { 12 var_dump(dirname("/foo/bar/baz", $i)); 13 } catch (\ValueError $e) { 14 echo $e->getMessage() . "\n"; 15 } 16} 17var_dump(dirname("/foo/bar/baz", PHP_INT_MAX)); 18?> 19--EXPECT-- 20dirname(): Argument #2 ($levels) must be greater than or equal to 1 21string(8) "/foo/bar" 22string(4) "/foo" 23string(1) "/" 24string(1) "/" 25string(1) "/" 26