| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Establishment of Sheikh Kamal IT Training & Incubation Center project Question Bank Ezze Technology Limited | |||||||||||||||||||||||||
2 | category id | Q.title | Q.A | Q.B | Q.C | Q.D | right answers | |||||||||||||||||||
3 | 1 | What does PHP stand for? | Personal Home Page | Hypertext Preprocessor | Pretext Hypertext Processor | Personal Home Page and Hypertext Preprocessor | Personal Home Page and Hypertext Preprocessor | |||||||||||||||||||
4 | 2 | Who is the father of PHP? | Rasmus Lerdorf | Willam Makepiece | Drek Kolkevi | List Barely | Rasmus Lerdorf | |||||||||||||||||||
5 | 3 | PHP files have a default file extension of. | .html | .xml | .php | .ph | .php | |||||||||||||||||||
6 | 4 | A PHP script should start with ___ and end with ___: | < php > | <?php ?> | < ? ? > | < ? php ? > | <?php ?> | |||||||||||||||||||
7 | 5 | Which of the following is/are a PHP code editor? ditor? | Notepad -- | Notepad++ | Adobe photoshop | All of them | Notepad++ | |||||||||||||||||||
8 | 6 | Which of the following must be installed on your computer so as to run PHP script? | Adobe photoshop | PHP | Apache | Mysql | php and apache | |||||||||||||||||||
9 | 7 | Which version of PHP introduced Try/catch Exception? | PHP 4 | PHP 5 | PHP 5.3 | PHP 6 | PHP 5 | |||||||||||||||||||
10 | 8 | We can use ___ to comment a single line? | /? | / | # | /* */ | # | |||||||||||||||||||
11 | 9 | Which of the below symbols is a newline character? | \r | \n | /n | /r | \n | |||||||||||||||||||
12 | 10 | Which of the following php statement/statements will store 111 in variable num? | int $num = 111; | int mum = 111; | $num = 111; | 111 = $num; | $num = 111; | |||||||||||||||||||
13 | 11 | What will be the output of the following php code < ?php $num = 1; $num1 = 2; print $num . "+". $num1 ; ?> | 3 | 1+2 | 1.+.2 | Error | 1+2 | |||||||||||||||||||
14 | 12 | What will be the output of the following php code? < ?php $num = "1"; $num1 = "2"; print $num+$num1 ; ?> | 3 | 1+2 | 1.+.2 | Error | 3 | |||||||||||||||||||
15 | 13 | Which of following variables can be assigned a value to it? | $3hello | $_hello | $This | $The | $This | |||||||||||||||||||
16 | 14 | What will be the output of the following code? < ?php $foo = 'Bob'; $bar = &$foo; $bar = "My name is $bar"; echo $bar; echo $foo; ?> | Error | My name is BobBob | My name is BobMy name is Bob | My name is Bob Bob | My name is BobMy name is Bob | |||||||||||||||||||
17 | 15 | Which of the following PHP statements will output Hello World on the screen? | echo (“Hello World”); | prit (“Hello World”); | print_mf (“Hello World”); | sprintf (“Hello World”); | echo (“Hello World”); | |||||||||||||||||||
18 | 16 | What will be the output of the following PHP code? < ?php $color = "maroon"; $var = $color[2]; echo "$var" ; ?> | a | Error | $var | r | r | |||||||||||||||||||
19 | 17 | What will be the output of the following PHP code? < ?php $total = "25 students"; $more = 10; $total = $total + $more; echo "$total" ; ?> | Error | 35 students | 35 | 25 students | 35 | |||||||||||||||||||
20 | 18 | Which of the below statements is equivalent to $add += $add ? | $add = $add | $add = $add +$add | $add = $add + 1 | $add = $add + $add + 1 | $add = $add +$add | |||||||||||||||||||
21 | 19 | Which statement will output $x on the screen? | echo “\$x” | echo “$$x”; | echo “/$x”; | echo “$x; | echo “\$x” | |||||||||||||||||||
22 | 20 | What will be the output of the following code? < ?php function track() { static $count = 0; $count++; echo $count ; } track(); track(); track(); ?> | 123 | 111 | 0 | 11 | 123 | |||||||||||||||||||
23 | 21 | What will be the output of the following PHP code? < ?php $a = "clue"; $a .= "get"; echo "$a"; ?> | get | TRUE | FALSE | clueget | clueget | |||||||||||||||||||
24 | 22 | What will be the output of the following PHP code? < ?php $team = "arsenal"; switch ($team) { case "manu": echo "I love man u"; case "arsenal": echo "I love arsenal"; case "manc": echo "I love manc"; } ?> | I love arsenal | Error | I love arsenalI love manc | I love arsenalI love | I love arsenalI love manc | |||||||||||||||||||
25 | 23 | What will be the output of the following PHP code? < ?php $num = 10; echo 'What is her age? \n She is $num years old'; ?> | What is her age? \n She is $num years old | What is her age? | What is her age? She is 10 years old | What is her age?She is/ n years old | What is her age? \n She is $num years old | |||||||||||||||||||
26 | 24 | Which one of the following PHP functions can be used to build a function that accepts any number of arguments? | func_get_argv() | func_get_argc() | get_argv() | get_argc() | func_get_argc() | |||||||||||||||||||
27 | 25 | Which one of the following PHP functions can be used to find files? | glob() | file() | fold() | get_file() | glob() | |||||||||||||||||||
28 | 26 | The filesize() function returns the file size in ___. | bits | bytes | kilobytes | gigabytes | bytes | |||||||||||||||||||
29 | 27 | Which one of the following PHP function is used to determine a file’s last access time? | fileltime() | filectime() | fileatime() | filetime() | fileatime() | |||||||||||||||||||
30 | 28 | Which one of the following function is capable of reading a file into an array? | file() | arrfile() | arr_file() | file_arr() | file() | |||||||||||||||||||
31 | 29 | Which one of the following function is capable of reading a file into a string variable? | file_contents() | file_get_contents() | file_content() | file_get_content() | file_get_contents() | |||||||||||||||||||
32 | 30 | Which one of the following function is capable of reading a specific number of characters form a file? | fgets() | fget() | fileget() | filegets() | fgets() | |||||||||||||||||||
33 | 31 | Which one of the following function operates similarly to fgets(), except that it also strips any HTML and PHP tags form the input? | fgetsh() | fgetsp() | fgetsa() | fgetss() | fgetss() | |||||||||||||||||||
34 | 32 | Which one of the following function outputs the contents of a string variable to the specified resource? | filewrite() | fwrite() | filewrites() | fwrites() | fwrite() | |||||||||||||||||||
35 | 33 | Which function sets the file filename’s last-modified and last-accessed times? | sets() | set() | touch() | touched() | touch() | |||||||||||||||||||
36 | 34 | Which function is useful when you want to output the executed command’s result? | out_cmm() | out_system() | cmm() | system() | system() | |||||||||||||||||||
37 | 35 | Which one of the following function reads a directory into an Array? | scandir() | readdir() | scandirectory() | readdirectory() | scandir() | |||||||||||||||||||
38 | 36 | Type Hinting was introduced in which version of PHP? | PHP 4 | PHP 5 | PHP 5.3 | PHP 6 | PHP 5 | |||||||||||||||||||
39 | 37 | Which of the following PHP functions can be used to get the current memory usage? | get_usage() | get_peak_usage() | get_memory_usage() | get_memory_peak_usage() | get_memory_usage() | |||||||||||||||||||
40 | 38 | Which of the following PHP functions can be used for generating unique id’s? | uniqueid() | id() | md5() | mdid() | uniqueid() | |||||||||||||||||||
41 | 39 | Which one of the following functions can be used to compress a string? | zip_compress() | zip() | compress() | gzcompress() | gzcompress() | |||||||||||||||||||
42 | 40 | What will be the output of the following PHP code? < ?php echo "chr(52)"; ?> | 1 | 2 | 3 | 4 | 4 | |||||||||||||||||||
43 | 41 | What will be the output of the following PHP code? < ?php echo ord ("hi"); ?> | 101 | 102 | 103 | 104 | 104 | |||||||||||||||||||
44 | 42 | What will be the output of the following PHP code? < ?php $str = "Hello World" echo wordwrap($str,5," \n"); ?> | Hello World | Hello World | Hell o wo rld | World | Hello World | |||||||||||||||||||
45 | 43 | What will be the output of the following PHP code? < ?php echo ucwords("i love my country"); ?> | I love my country | i love my Country | I love my Country | I Love My Country | I Love My Country | |||||||||||||||||||
46 | 44 | What will be the output of the following PHP code? < ?php echo lcfirst("welcome to Bangladesh"); ?> | welcome to Bangladesh | welcome to bangladesh | Welcome to bangladesh | Welcome to bangladesh | welcome to Bangladesh | |||||||||||||||||||
47 | 45 | What will happen in this function call? < ?php function calc($price,$tax) { $total = $price + $tax; } $pricetag = 15; $taxtag = 3; calc($pricetag, $taxtag); ?> | Call By Value | Call By Reference | Default Argument Value | Type Hinting | Call By Value | |||||||||||||||||||
48 | 46 | What will be the output of the following PHP code? < ?php function calc($price, $tax="") { $total = $price + ($price * $tax); echo "$total"; } calc(42); ?> | Error | 42 | 0 | 84 | 42 | |||||||||||||||||||
49 | 47 | Which of the following are valid function names? | function() | €() | .function() | $function() | function() | |||||||||||||||||||
50 | 48 | What will be the output of the following PHP code? < ?php function a() { function b() { echo 'I am b'; } echo 'I am a'; } a(); a(); ?> | I am b | I am bI am a | Error | I am a Error | I am a Error | |||||||||||||||||||
51 | 49 | What will be the output of the following PHP code? < ?php function a() { function b() { echo 'I am b'; } echo 'I am a'; } b(); a(); ?> | I am b | I am bI am a | Error | I am a Error | Error | |||||||||||||||||||
52 | 50 | What will be the output of the following PHP code? < ?php $op2 = "blabla"; function foo($op1) { echo $op1; echo $op2; } foo("hello"); ?> | helloblabla | Error | hello | helloblablablabla | hello | |||||||||||||||||||
53 | 51 | A function in PHP which starts with __ (double underscore) is know as.. | Magic Function | Inbuilt Function | Default Function | User Defined Function | Magic Function | |||||||||||||||||||
54 | 52 | What will be the output of the following PHP code? < ?php function foo($msg) { echo "$msg"; } $var1 = "foo"; $var1("will this work"); ?> | Error | $msg | Error | will this work | will this work | |||||||||||||||||||
55 | 53 | PHP’s numerically indexed array begin with position __. | 0 | 1 | 2 | 3 | 0 | |||||||||||||||||||
56 | 54 | Which of the functions is used to sort an array in descending order? | sort() | rsort() | arsort() | dsort() | rsort() | |||||||||||||||||||
57 | 55 | Which of the following are correct ways of creating an array? | state[0] = “karnataka”; | $state[] = array(“karnataka”); | $state[0] = “karnataka”; | $state = array(“karnataka”); | $state[0] = “karnataka”; and $state = array(“karnataka”); | |||||||||||||||||||
58 | 56 | What will be the output of the following PHP code? < ?php $fruits = array ("mango", "apple", "pear", "peach"); $fruits = array_flip($fruits); echo ($fruits[0]); ?> | mango | Error | peach | 0 | Error | |||||||||||||||||||
59 | 57 | What will be the output of the following php code? < ?php $states = array("karnataka" => array ( "population" => "11,35,000", "captial" => "Bangalore"), "Tamil Nadu" => array( "population" => "17,90,000", "captial" => "Chennai") ); echo $states["karnataka"]["population"]; ?> | karnataka 11,35,000 | 11,35,000 | population 11,35,000 | karnataka population | 11,35,000 | |||||||||||||||||||
60 | 58 | Which function will return true if a variable is an array or false if it is not? | this_array() | is_array() | do_array() | in_array() | is_array() | |||||||||||||||||||
61 | 59 | Which in-built function will add a value to the end of an array? | array_unshift() | into_array() | inend_array() | array_push() | array_push() | |||||||||||||||||||
62 | 60 | What will be the output of the following PHP code? < ?php $state = array ("Karnataka", "Goa", "Tamil Nadu", "Andhra Pradesh"); echo (array_search ("Tamil Nadu", $state) ); ?> | TRUE | 1 | FALSE | 2 | 2 | |||||||||||||||||||
63 | 61 | What will be the output of the following PHP code? < ?php $fruits = array ("apple", "orange", "banana"); echo (next($fruits)); echo (next($fruits)); ?> | orangebanana | appleorange | orangeorange | appleapple | orangebanana | |||||||||||||||||||
64 | 62 | Which function can be used to move the pointer to the previous array position? | last() | before() | prev() | previous() | prev() | |||||||||||||||||||
65 | 63 | What will be the output of the following PHP code? < ?php $fruits = array ("apple", "orange", array ("pear", "mango"), "banana"); echo (count($fruits, 1)); ?> | 3 | 4 | 5 | 6 | 6 | |||||||||||||||||||
66 | 64 | Which function returns an array consisting of associative key/value pairs? | count() | array_count() | array_count_values() | count_values() | array_count_values() | |||||||||||||||||||
67 | 65 | Say in the above question you need to get the array sorted in the manner we humans would have done it i.e picture1 then picture2 etc.. Which of the following function should be used? | dsort() | casesort() | natcasesort() | naturalsort() | natcasesort() | |||||||||||||||||||
68 | 66 | What will be the output of the following PHP code? < ?php $fruits = array ("apple", "mango", "peach", "pear", "orange"); $subset = array_slice ($fruits, 2); print_r ($subset); ?> | Array ( [0] => peach ) | Array ( [0] => apple [1] => mango [2] => peach ) | Array ( [0] => apple [1] => mango ) | Array ( [0] => peach [1] => pear [2] => orange ) | Array ( [0] => peach [1] => pear [2] => orange ) | |||||||||||||||||||
69 | 67 | What will be the output of the following PHP code? < ?php $fruits = array ("apple", "mango", "peach", "pear", "orange"); $subset = array_splice ($fruits, 2); print_r ($fruits); ?> | Error | Array ( [0] => apple [1] => mango [2] => peach ) | Array ( [0] => apple [1] => mango ) | Array ( [0] => pear [1] => orange ) | Array ( [0] => apple [1] => mango ) | |||||||||||||||||||
70 | 68 | What will be the output of the following PHP code? < ?php $number = array ("4", "hello", 2); echo (array_sum ($number)); ?> | 4hello2 | 2 | 4 | 6 | 6 | |||||||||||||||||||
71 | 69 | How many functions does PHP offer for searching and modifying strings using Perl-compatible regular expressions. | 7 | 8 | 9 | 10 | 8 | |||||||||||||||||||
72 | 70 | Say we have two compare two strings which of the following function/functions can you use? | strcmp() | strcasecmp() | strspn() | All of the mentioned | All of the mentioned | |||||||||||||||||||
73 | 71 | Which one of the following functions will convert a string to all uppercase? | strtoupper() | struppercase() | str_uppercase() | uppercase() | strtoupper() | |||||||||||||||||||
74 | 72 | What will be the output of the following PHP code? < ?php $title = "O'malley wins the heavyweight championship!"; echo ucwords($title); ?> | O’Malley Wins The Heavyweight Championship! | O’malley Wins The Heavyweight Championship! | O’Malley wins the heavyweight championship! | o’malley wins the heavyweight championship! | o’malley wins the heavyweight championship! | |||||||||||||||||||
75 | 73 | What will be the output of the following PHP code? < ?php echo str_pad("Salad", 5)." is good."; ?> | SaladSaladSaladSaladSalad is good | is good SaladSaladSaladSaladSalad | is good Salad | Salad is good | Salad is good | |||||||||||||||||||
76 | 74 | Which one of the following functions can be used to concatenate array elements to form a single delimited string? | explode() | implode() | concat() | concatenate() | implode() | |||||||||||||||||||
77 | 75 | Which one of the following functions finds the last occurrence of a string, returning its numerical position? | strlastpos() | strpos() | strlast() | strrpos() | strrpos() | |||||||||||||||||||
78 | 76 | What will be the output of the following PHP code? < ?php $url = "nachiketh@example.com"; echo ltrim(strstr($url, "@"),"@"); ?> | nachiketh@example.com | nachiketh | nachiketh@ | example.com | example.com | |||||||||||||||||||
79 | 77 | Which one of the following regular expression matches any string containing zero or one p? | p+ | p* | P? | p# | P? | |||||||||||||||||||
80 | 78 | [:alpha:] can also be specified as.. | [A-Za-z0-9] | [A-za-z] | [A-z] | [a-z] | [A-za-z] | |||||||||||||||||||
81 | 79 | How many functions does PHP offer for searching strings using POSIX style regular expression? | 7 | 8 | 9 | 5 | 7 | |||||||||||||||||||
82 | 80 | POSIX implementation was deprecated in which version of PHP? | PHP 4 | PHP 5 | PHP 5.3 | PHP 6 | PHP 5.3 | |||||||||||||||||||
83 | 81 | POSIX stands for | Portable Operating System Interface for Unix | Portable Operating System Interface for Linux | Portative Operating System Interface for Unix | Portative Operating System Interface for Linux | Portable Operating System Interface for Unix | |||||||||||||||||||
84 | 82 | Which method scope prevents a method from being overridden by a subclass? | Abstract | Protected | Final | Static | Final | |||||||||||||||||||
85 | 83 | PHP recognizes constructors by the name. | classname() | _construct() | function _construct() | function __construct() | function __construct() | |||||||||||||||||||
86 | 84 | Which version of PHP introduced the instanceof keyword? | PHP 4 | php 5 | PHP 5.3 | PHP 6 | php 5 | |||||||||||||||||||
87 | 85 | Which one of the following functions is used to determine whether a class exists? | exist() | exist_class() | class_exist() | __exist() | class_exist() | |||||||||||||||||||
88 | 86 | Which one of the following functions is used to determine object type? | obj_type() | type() | is_a() | is_obj() | is_a() | |||||||||||||||||||
89 | 87 | Which one of the following keyword is used to inherit our subclass into a superclass? | extends | implements | inherit | include | extends | |||||||||||||||||||
90 | 88 | In the PHP code given below, what is/are the properties? < ?php class Example { public $name; function Sample() { echo "This is an example"; } } ?> | echo “This is an example”; | public $name; | class Example | function sample() | public $name; | |||||||||||||||||||
91 | 89 | Which keyword is used to refer to properties or methods within the class itself? | private | public | protected | $this | $this | |||||||||||||||||||
92 | 90 | Which keyword allows class members (methods and properties) to be used without needing to instantiate a new instance of the class? | protected | final | static | private | static | |||||||||||||||||||
93 | 91 | The practice of separating the user from the true inner workings of an application through well-known interfaces is known as.. | Polymorphism | Inheritance | Encapsulation | Abstraction | Encapsulation | |||||||||||||||||||
94 | 92 | hich of the following term originates from the Greek language that means “having multiple forms,” defines OOP’s ability to redefine, a class’s characteristic | Abstraction | Polymorphism | Inheritance | Differential | Polymorphism | |||||||||||||||||||
95 | 93 | The practice of creating objects based on predefined classes is often referred to as.. | class creation | object creation | object instantiation | class instantiation | ||||||||||||||||||||
96 | 94 | Which one of the following property scopes is not supported by PHP? | friendly | final | public | static | friendly | |||||||||||||||||||
97 | 95 | Which one of the following can be used to instantiate an object in PHP assuming class name to be Foo? | $obj = new $foo; | $obj = new foo; | $obj = new foo (); | obj = new foo (); | $obj = new foo (); | |||||||||||||||||||
98 | 96 | Which one of the following is the right way to define a constant? | constant PI = “3.1415?; | const $PI = “3.1415?; | constant PI = ’3.1415'; | const PI = ’3.1415'; | const PI = ’3.1415'; | |||||||||||||||||||
99 | 97 | Which one of the following is the right way to call a class constant, given that the class is mathFunction? | echo PI; | echo mathFunction->PI; | echo mathFunction::PI; | echo mathFunction=PI; | echo mathFunction::PI; | |||||||||||||||||||
100 | 98 | Which one of the following is the right way to invoke a method? | $object->methodName(); | object->methodName(); | object::methodName(); | $object::methodName(); | $object->methodName(); | |||||||||||||||||||