[ PHP Programming MCQS ]
झारखंड में आयोजित होने वाली JPSC, JSSC, JET, झारखंड पुलिस भर्ती परीक्षा आदि के लिए उपयोगी सामान्य अध्ययन।
[ PHP Programming MCQS ]
Useful GK for JPSC, JSSC, JET, Jharkhand Police and other exams.
261. ReflectionClass किसके बारे में जानकारी देता है?
[A] Database Table
[B] Class Structure
[C] Session
[D] Cookie
261. What does ReflectionClass provide information about?
[A] Database Table
[B] Class Structure
[C] Session
[D] Cookie
सही उत्तर: Class Structure
व्याख्या: Class metadata प्राप्त करने के लिए।
Correct Answer: Class Structure
Explanation: Used to inspect class metadata.
262. Anonymous Class किस version में introduce हुई?
[A] PHP 5.4
[B] PHP 5.6
[C] PHP 7
[D] PHP 8
262. Anonymous Classes were introduced in which PHP version?
[A] PHP 5.4
[B] PHP 5.6
[C] PHP 7
[D] PHP 8
सही उत्तर: PHP 7
व्याख्या: Temporary class definitions के लिए।
Correct Answer: PHP 7
Explanation: Introduced for temporary class definitions.
263. Anonymous Class object बनाने का syntax क्या है?
[A] new class {}
[B] class new {}
[C] object class {}
[D] anonymous {}
263. What is the syntax for creating an Anonymous Class?
[A] new class {}
[B] class new {}
[C] object class {}
[D] anonymous {}
सही उत्तर: new class {}
व्याख्या: Inline class definition।
Correct Answer: new class {}
Explanation: Defines a class inline.
264. PHP में callable type किसका प्रतिनिधित्व करता है?
[A] Database Connection
[B] Callable Function/Method
[C] Array Only
[D] Object Only
264. What does callable type represent?
[A] Database Connection
[B] Callable Function/Method
[C] Array Only
[D] Object Only
सही उत्तर: Callable Function/Method
व्याख्या: Functions और methods को दर्शाता है।
Correct Answer: Callable Function/Method
Explanation: Represents functions and methods.
265. Namespace separator कौन-सा होता है?
[A] /
[B] \
[C] .
[D] ::
265. What is the namespace separator in PHP?
[A] /
[B] \
[C] .
[D] ::
सही उत्तर: \
व्याख्या: Namespaces को अलग करने के लिए।
Correct Answer: \
Explanation: Used to separate namespaces.
266. Global namespace को refer करने के लिए क्या प्रयोग किया जाता है?
[A] @
[B] #
[C] \
[D] ::
266. How do you refer to the global namespace?
[A] @
[B] #
[C] \
[D] ::
सही उत्तर: \
व्याख्या: Root namespace access करने के लिए।
Correct Answer: \
Explanation: Used to access root namespace.
267. Trait में method aliasing के लिए कौन-सा keyword प्रयोग होता है?
[A] as
[B] alias
[C] useas
[D] rename
267. Which keyword is used for method aliasing in Traits?
[A] as
[B] alias
[C] useas
[D] rename
सही उत्तर: as
व्याख्या: Method का नया नाम देने के लिए।
Correct Answer: as
Explanation: Used to create method aliases.
268. Late Static Binding के लिए कौन-सा keyword प्रयोग होता है?
[A] self
[B] this
[C] static
[D] parent
268. Which keyword is used for Late Static Binding?
[A] self
[B] this
[C] static
[D] parent
सही उत्तर: static
व्याख्या: Runtime class resolution के लिए।
Correct Answer: static
Explanation: Provides runtime class resolution.
269. self:: और static:: में मुख्य अंतर क्या है?
[A] कोई अंतर नहीं
[B] static late binding support करता है
[C] self faster है
[D] static केवल PHP 8 में है
269. What is the key difference between self:: and static::?
[A] No difference
[B] static supports late binding
[C] self is faster
[D] static exists only in PHP 8
सही उत्तर: static late binding support करता है
व्याख्या: Inheritance scenarios में अंतर पड़ता है।
Correct Answer: static supports late binding
Explanation: Important in inheritance scenarios.
270. PHP में __invoke() magic method कब execute होती है?
[A] Object Call होने पर
[B] File Open होने पर
[C] Session Start होने पर
[D] Array Access पर
270. When is __invoke() executed?
[A] When object is called like a function
[B] When file opens
[C] When session starts
[D] On array access
सही उत्तर: Object Call होने पर
व्याख्या: Object को function की तरह call करने पर।
Correct Answer: When object is called like a function
Explanation: Executed when object behaves like a function.