JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
PHP interview questions part 1
PHP interview questions part 1
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. What does PHP stand for?
A. Preprocessed Hypertext Page
B. Hypertext Markup Language
C. PHP: Hypertext Preprocessor
D. Hypertext Transfer Protocol
Show Correct Answer
Correct Answer is :
PHP: Hypertext Preprocessor
2. Which of the following is the way to create comments in PHP?
A. // commented code to end of line
B. /* commented code here */
C. # commented code to end of line
D. all of the above
Show Correct Answer
Correct Answer is :
all of the above
3. A value that has no defined value is expressed in PHP with the following keyword:
A. undef
B.
C. None
D. There is no such concept in PHP
Show Correct Answer
Correct Answer is :
4. Which of the following is used to declare a constant
A. const
B. constant
C. define
D. #pragma
Show Correct Answer
Correct Answer is :
define
5. Which of the following is NOT a magic predefined constant?
A. __LINE__
B. __FILE__
C. __DATE__
D. __CLASS__
Show Correct Answer
Correct Answer is :
__DATE__
6. What is the output of the following? x = "abcdef" i = "a" while i in x: print(i, end = " ")
A. All of the mentioned
B. None of the mentioned
C. i) and ii)
D. iii) and iv)
Show Correct Answer
Correct Answer is :
i) and ii)
7. What is the output of the following? x = "abcdef" i = "a" while i in x: print('i', end = " ")
A. PHP 4
B. PHP 5
C. PHP 5.3
D. PHP 6
Show Correct Answer
Correct Answer is :
PHP 5
8. What is the output of the following? x = "abcdef" i = "a" while i in x: x = x[:-1] print(i, end = " ")
A. _clone(targetObject);
B. destinationObject = clone targetObject;
C. destinationObject = _clone(targetObject);
D. destinationObject = clone(targetObject);
Show Correct Answer
Correct Answer is :
destinationObject = clone targetObject;
9. What is the output of the following? x = "abcdef" i = "a" while i in x[:-1]: print(i, end = " ")
A. Only ii)
B. All of the mentioned
C. ii) and iv)
D. ii), iii) and iv)
Show Correct Answer
Correct Answer is :
ii), iii) and iv)
10. What is the output of the following? x = "abcdef" i = "a" while i in x: x = x[1:] print(i, end = " ")
A. Normal class
B. Static class
C. Abstract class
D. Interface
Show Correct Answer
Correct Answer is :
Normal class
11. What is the output of the following? x = "abcdef" i = "a" while i in x[1:]: print(i, end = " ")
A. Interface
B. Object
C. Abstract class
D. Static class
Show Correct Answer
Correct Answer is :
Abstract class
12. What is the output of the following? x = 'abcd' for i in x: print(i) x.upper()
A. clone()
B. __clone()
C. _clone
D. object_clone()
Show Correct Answer
Correct Answer is :
clone()
13. What is the output of the following? x = 'abcd' for i in x: print(i.upper())
A. Typecasting
B. Method Including
C. Method adding
D. Method chaining
Show Correct Answer
Correct Answer is :
Method Including
14. What is the output of the following? x = 'abcd' for i in range(x): print(i)
A. __call
B. __invoke
C. __wakeup
D. __unset
Show Correct Answer
Correct Answer is :
__unset
15. What is the output of the following? x = 'abcd' for i in range(len(x)): print(i)
A. 1
B. 2
C. 0
D. -1
Show Correct Answer
Correct Answer is :
0
16. What is the output of the following? x = 'abcd' for i in range(len(x)): print(i.upper())
A. iii) and iv)
B. ii) and iii)
C. Only i)
D. ii), iii) and iv)
Show Correct Answer
Correct Answer is :
iii) and iv)
17. What is the output of the following? x = 'abcd' for i in range(len(x)): i.upper() print (x)
A. karnataka 11,35,000
B. 11,35,000
C. population 11,35,000
D. karnataka population
Show Correct Answer
Correct Answer is :
11,35,000
18. What is the output of the following? x = 'abcd' for i in range(len(x)): x[i].upper() print (x)
A. this_array()
B. is_array()
C. do_array()
D. in_array()
Show Correct Answer
Correct Answer is :
is_array()
19. What is the output of the following? x = 'abcd' for i in range(len(x)): i[x].upper() print (x)
A. array_unshift()
B. into_array()
C. inend_array()
D. array_push()
Show Correct Answer
Correct Answer is :
array_push()
20. What is the output of the following? x = 'abcd' for i in range(len(x)): x = 'a' print(x)
A. TRUE
B. 1
C. FALSE
D. 2
Show Correct Answer
Correct Answer is :
2
Similar Interview Questions
Search for latest jobs
Find Jobs