1--TEST-- 2Test function posix_setuid() by substituting argument 1 with float values. 3--SKIPIF-- 4<?php 5 PHP_INT_SIZE == 4 or die("skip - 32-bit only"); 6 if(!extension_loaded("posix")) print "skip - POSIX extension not loaded"; 7 if(posix_geteuid() == 0) print "skip - Cannot run test as root."; 8?> 9--CREDITS-- 10Marco Fabbri mrfabbri@gmail.com 11Francesco Fullone ff@ideato.it 12#PHPTestFest Cesena Italia on 2009-06-20 13--FILE-- 14<?php 15 16 17echo "*** Test substituting argument 1 with float values ***\n"; 18 19$myUid = posix_getuid(); 20 21$myUid = $myUid - 1.1; 22 23$variation_array = array( 24 'float '.$myUid => $myUid, 25 'float -'.$myUid => -$myUid, 26 'float 12.3456789000e10' => 12.3456789000e10, 27 'float -12.3456789000e10' => -12.3456789000e10, 28 'float .5' => .5, 29 ); 30 31 32foreach ( $variation_array as $var ) { 33 var_dump(posix_setuid( $var ) ); 34} 35?> 36--EXPECTF-- 37*** Test substituting argument 1 with float values *** 38bool(false) 39bool(false) 40 41Warning: posix_setuid() expects parameter 1 to be int, float given in %s on line %d 42bool(false) 43 44Warning: posix_setuid() expects parameter 1 to be int, float given in %s on line %d 45bool(false) 46bool(false) 47