Vous êtes sur la page 1sur 3

PHP5 Test

1. Which of the following functions outputs text ? a) echo b) print c) println d) display 2. What will be the output of the following code ? <?php $a = 3; $b = 2; echo (int)$a / (int)$b; ?> a) 1 b) 1.5 c) 2 d) 3 e) Error 3. What will be the output of the following code ? <?php $var = 10; function fn(); { $var = 20; return $var; } fn(); echo $var; ?> 4. Which of the following attribute is needed for file upload via form ? a) enctype = multipart / form-data b) enctype = singlepart / data c) enctype = file d) enctype = form-data / file 5. What will be the value of $z ? <?php $x = 0xFFFE; $y = 2; $z = $x && $y; ?>

a) 0 b) 1 c) 2 d) 3 e) 4 6. What of the following is a correct declaration ? a) static $varb = array(1,val, 3'); b) static $varb = 1+(2*90); c) static $varb = sqrt(81); d) static $varb = new Object; 7. What will be the output of the following code ? <?php $a = 500; $b = 200; echo $a%2*$b; ?> a) 100; b) 200; c) 500; d) 0; e) Syntax Error 8. What will be the output of the following code ? <?php function fn(& $var) { $var = $var - ($var/10*5); return($var); } echo fn(100); a) 100; b) 50; c) 98; d) Error message e) None of above

9. What will be the output of the following code ? <?php for($i = 0; $i < 5; ++$i) { if($i == 2) continue; print $i ; } ?> a) 0 1 2 3 4 5; b) 0 1 3 4; c) 2; d) 0 1 2 4; e) None of the above

Vous aimerez peut-être aussi