[ PHP Programming MCQS ]
झारखंड में आयोजित होने वाली JPSC, JSSC, JET, झारखंड पुलिस भर्ती परीक्षा आदि के लिए उपयोगी सामान्य अध्ययन।
[ PHP Programming MCQS ]
Useful GK for JPSC, JSSC, JET, Jharkhand Police and other exams.
401. Generator में कौन-सा keyword प्रयोग होता है?
[A] return
[B] break
[C] yield
[D] next
401. Which keyword is used in Generators?
[A] return
[B] break
[C] yield
[D] next
सही उत्तर: yield
व्याख्या: Generator values yield करता है।
Correct Answer: yield
Explanation: Generators yield values.
402. PHP 7 में scalar type declarations का उदाहरण कौन-सा है?
[A] int
[B] float
[C] string
[D] सभी
402. Which is an example of scalar type declarations in PHP 7?
[A] int
[B] float
[C] string
[D] All of these
सही उत्तर: सभी
व्याख्या: int, float, string आदि scalar types हैं।
Correct Answer: All of these
Explanation: int, float, string etc. are scalar types.
403. declare(strict_types=1); का उद्देश्य क्या है?
[A] Strict Type Checking
[B] Enable Sessions
[C] Enable Cache
[D] Enable Namespaces
403. What is the purpose of declare(strict_types=1); ?
[A] Strict Type Checking
[B] Enable Sessions
[C] Enable Cache
[D] Enable Namespaces
सही उत्तर: Strict Type Checking
व्याख्या: Type coercion को रोकता है।
Correct Answer: Strict Type Checking
Explanation: Prevents automatic type coercion.
404. PHP में null coalescing operator कौन-सा है?
[A] ?:
[B] ??
[C] =>
[D] ===
404. Which is the null coalescing operator in PHP?
[A] ?:
[B] ??
[C] =>
[D] ===
सही उत्तर: ??
व्याख्या: Null होने पर default value देता है।
Correct Answer: ??
Explanation: Provides default value when null.
405. Spaceship operator कौन-सा है?
[A] <=>
[B] ==>
[C] <<<
[D] >>>
405. Which is the spaceship operator?
[A] <=>
[B] ==>
[C] <<<
[D] >>>
सही उत्तर: <=>
व्याख्या: Three-way comparison operator।
Correct Answer: <=>
Explanation: Performs three-way comparison.
406. PHP 8 में Match Expression का लाभ क्या है?
[A] Strict Comparison
[B] Fall-through नहीं होता
[C] Value Return करता है
[D] सभी
406. What are the benefits of Match Expression in PHP 8?
[A] Strict Comparison
[B] No Fall-through
[C] Returns Value
[D] All of these
सही उत्तर: सभी
व्याख्या: Match expression strict comparison और direct return देता है।
Correct Answer: All of these
Explanation: Provides strict comparison and direct value return.
407. PHP में mixed type का क्या अर्थ है?
[A] Any Type Accepted
[B] Only Integer
[C] Only String
[D] Only Array
407. What does mixed type mean in PHP?
[A] Any Type Accepted
[B] Only Integer
[C] Only String
[D] Only Array
सही उत्तर: Any Type Accepted
व्याख्या: Variable किसी भी type का हो सकता है।
Correct Answer: Any Type Accepted
Explanation: Variable can hold any type.
408. Union Types किस version में introduce हुए?
[A] PHP 7.4
[B] PHP 8.0
[C] PHP 8.1
[D] PHP 8.2
408. In which PHP version were Union Types introduced?
[A] PHP 7.4
[B] PHP 8.0
[C] PHP 8.1
[D] PHP 8.2
सही उत्तर: PHP 8.0
व्याख्या: एक parameter में multiple allowed types।
Correct Answer: PHP 8.0
Explanation: Allows multiple accepted types.
409. PHP में static keyword method के साथ प्रयोग करने पर क्या होता है?
[A] Object के बिना call किया जा सकता है
[B] Object जरूरी है
[C] Method private हो जाता है
[D] Method abstract हो जाता है
409. What happens when static is used with a method?
[A] Can be called without object
[B] Object is required
[C] Method becomes private
[D] Method becomes abstract
सही उत्तर: Object के बिना call किया जा सकता है
व्याख्या: Static methods class level पर होते हैं।
Correct Answer: Can be called without object
Explanation: Static methods belong to the class level.
410. PHP Code: $a = 5; $b = &$a; $a = 10; echo $b; Output क्या होगा?
[A] 5
[B] 10
[C] 0
[D] Error
410. PHP Code: $a = 5; $b = &$a; $a = 10; echo $b; What is the output?
[A] 5
[B] 10
[C] 0
[D] Error
सही उत्तर: 10
व्याख्या: Reference assignment (&) के कारण दोनों variables एक ही value को refer करते हैं।
Correct Answer: 10
Explanation: Reference assignment causes both variables to point to the same value.