Computer Science :: All Aptitude Test ::

1.What will be the output of the following PHP code?
A. Will this work
B. 0
C. $msg
D. Will this work

2.What will be the output of the following PHP code?
A. Will this work
B. 0
C. $msg
D. Will this work

3.Which of the following PHP functions accepts any number of parameters?
A. get_argc()
B. get_argv()
C. func_get_args()
D. get_argc()

4.Which one of the following PHP functions can be used to find files?
A. get_file()
B. fold()
C. file()
D. get_file()

5.Which of the following PHP functions can be used to get the current memory usage?
A. memory_get_peak_usage()
B. memory_get_usage()
C. get_peak_usage()
D. memory_get_peak_usage()

6.Which of the following PHP functions can be used for generating unique ids?
A. mdid()
B. md5()
C. id()
D. mdid()

7.Which one of the following functions can be used to compress a string?
A. gzcompress()
B. compress()
C. zip()
D. gzcompress()

8.What will be the output of the following PHP code?
A. 1
B. 2
C. 3
D. 1

9.What will be the output of the following PHP code?
A. 209
B. 104
C. 103
D. 209

10.What will be the output of the following PHP code?
A. I Love My Country
B. I love my Country
C. i love my Country
D. I Love My Country

11.What will be the output of the following PHP code?
A. Welcome to pakistan
B. Welcome to Pakistan
C. welcome to pakistan
D. Welcome to pakistan

12.PHP’s numerically indexed array begin with position?
A. -1
B. 0
C. 1
D. -1

13.Which of the following PHP function will return true if a variable is an array or false if it is not an array?
A. in_array()
B. do_array()
C. is_array()
D. in_array()

14.Which in-built function will add a value to the end of an array?
A. array_push()
B. inend_array()
C. into_array()
D. array_push()

15.What will be the output of the following PHP code?
A. appleapple
B. orangeorange
C. appleorange
D. appleapple

16.Which of the following function is used to get the value of the previous element in an array?
A. previous()
B. prev()
C. before()
D. previous()

17.What will be the output of the following PHP code?
A. 2
B. 4
C. 6
D. 2

18.What will be the output of the following PHP code?
A. I like Toyota, BMW and Honda
B. I like BMW, Honda and Toyota
C. I like Honda, BMW and Toyota
D. I like Toyota, BMW and Honda

19.What will be the output of the following PHP code?
A. Array ([35] => Peter [37] => Ben [43] => Joe)
B. Array (35 37 43)
C. Array ([Peter] => 35 [Ben] => 37 [Joe] => 43)
D. Array ([35] => Peter [37] => Ben [43] => Joe)

20.What will be the output of the following PHP code?
A. Array ( [A] => 2 [Tiger] => 1 )
B. Array ( [A] => 6 [Cat] => 1 [Dog] => 2 [Tiger] => 1 )
C. Array ( [A] => 2 [Cat] => 2 [Dog] => 1 [Tiger] => 1 )
D. Array ( [A] => 2 [Tiger] => 1 )

21.What will be the output of the following PHP code?
A. Array ( [d] => yellow )
B. Array ( [i] => orange )
C. Array ( [h] => orange )
D. Array ( [d] => yellow )

22.What will be the output of the following PHP code?
A. Array ( [a] => red [b] => green [c] => blue [d] => yellow )
B. Array ( [0] => red [1] => green [2] => blue [3] => yellow )
C. Array ( [0] => blue [1] => yellow [2] => red [3] => green )
D. Array ( [a] => red [b] => green [c] => blue [d] => yellow )

23.What will be the output of the following PHP code?
A. Error
B. Sam is the brother of Jack and Bob
C. Samis the brother of Bob and Bob
D. Error

24.What will be the output of the following PHP code?
A. Error
B. $brother
C. Sam is the brother of Bob and Bob)
D. Error

25.What will be the output of the following PHP code?
A. Array ( [0] => LA [1] => Paris )
B. Array ( [0] => NYC [1] => LA [2] => Paris [3] => Paris )
C. Array ( [0] => NYC [1] => LA [2] => Paris)
D. Array ( [0] => LA [1] => Paris )

26.The practice of separating the user from the true inner workings of an application through well-known interfaces is known as?
A. Abstraction
B. Encapsulation
C. Inheritance
D. Abstraction

27.Which of the following term originates from the Greek language that means “having multiple forms,” defines OOP’s ability to redefine, a class’s characteristics?
A. Differential
B. Inheritance
C. Polymorphism
D. Differential

28.The practice of creating objects based on predefined classes is often referred to as?
A. Class instantiation
B. Object instantiation
C. Object creation
D. Class instantiation

29.Which one of the following property scopes is not supported by PHP?
A. Static
B. Public
C. Final
D. Static

30.Which one of the following can be used to instantiate an object in PHP assuming class name to be Foo?
A. obj = new foo ();
B. $obj = new foo ();
C. $obj = new foo;
D. obj = new foo ();


Date to Date Current Affairs 2022

PakMCQs.net

Quick Links

GAT Subject



   Computer Science    English Mcqs    Agriculture    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC Papers