Engineering :: All Aptitude Test ::

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

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

3.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()

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

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

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

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

8.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

9.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

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

11.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()

12.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()

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

14.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()

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

16.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

17.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)

18.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 )

19.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 )

20.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 )

21.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

22.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

23.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 )

24.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

25.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

26.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

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

28.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 ();

29.Which one of the following is the right way to define a constant?
A. const PI = ‘3.1415’;
B. constant PI = ‘3.1415’;
C. const $PI = “3.1415”;
D. const PI = ‘3.1415’;

30.Which one of the following is the right way to call a class constant, given that the class is mathFunction?
A. echo mathFunction=PI;
B. echo mathFunction::PI;
C. echo mathFunction->PI;
D. echo mathFunction=PI;


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