[ PHP Programming MCQS ]

झारखंड में आयोजित होने वाली JPSC, JSSC, JET, झारखंड पुलिस भर्ती परीक्षा आदि के लिए उपयोगी सामान्य अध्ययन।

[ PHP Programming MCQS ]

Useful GK for JPSC, JSSC, JET, Jharkhand Police and other exams.
391. empty("0") का result क्या होगा?
[A] false
[B] true
[C] NULL
[D] Error
391. What is the result of empty("0")?
[A] false
[B] true
[C] NULL
[D] Error
सही उत्तर: true
व्याख्या: "0" को empty माना जाता है।
Correct Answer: true
Explanation: "0" is considered empty in PHP.
392. PHP में __construct() कब execute होता है?
[A] Object Creation पर
[B] Object Delete पर
[C] Function Call पर
[D] Page Load पर
392. When is __construct() executed?
[A] On Object Creation
[B] On Object Deletion
[C] On Function Call
[D] On Page Load
सही उत्तर: Object Creation पर
व्याख्या: Constructor object बनते समय execute होता है।
Correct Answer: On Object Creation
Explanation: Constructor executes when object is created.
393. PHP में final class का क्या अर्थ है?
[A] Class inherit नहीं हो सकती
[B] Class instantiate नहीं हो सकती
[C] Class abstract है
[D] Class private है
393. What does a final class mean in PHP?
[A] Cannot be inherited
[B] Cannot be instantiated
[C] Is abstract
[D] Is private
सही उत्तर: Class inherit नहीं हो सकती
व्याख्या: Final class को extend नहीं किया जा सकता।
Correct Answer: Cannot be inherited
Explanation: A final class cannot be extended.
394. Interface में methods by default कैसे होते हैं?
[A] Private
[B] Protected
[C] Public
[D] Static
394. How are interface methods by default?
[A] Private
[B] Protected
[C] Public
[D] Static
सही उत्तर: Public
व्याख्या: Interface methods implicitly public होते हैं।
Correct Answer: Public
Explanation: Interface methods are implicitly public.
395. PHP में trait का उद्देश्य क्या है?
[A] Multiple Inheritance जैसा व्यवहार
[B] Database Access
[C] Session Storage
[D] Caching
395. What is the purpose of a trait in PHP?
[A] Behavior similar to multiple inheritance
[B] Database Access
[C] Session Storage
[D] Caching
सही उत्तर: Multiple Inheritance जैसा व्यवहार
व्याख्या: Code reuse के लिए traits उपयोग होते हैं।
Correct Answer: Behavior similar to multiple inheritance
Explanation: Traits are used for code reuse.
396. Exception handle करने के लिए कौन-सा block उपयोग होता है?
[A] if
[B] catch
[C] switch
[D] while
396. Which block is used to handle exceptions?
[A] if
[B] catch
[C] switch
[D] while
सही उत्तर: catch
व्याख्या: Exceptions catch block में handle की जाती हैं।
Correct Answer: catch
Explanation: Exceptions are handled in catch blocks.
397. throw keyword का उपयोग किसलिए होता है?
[A] Exception Generate
[B] Exception Delete
[C] Function Call
[D] Loop Break
397. What is throw used for?
[A] Generate Exception
[B] Delete Exception
[C] Call Function
[D] Break Loop
सही उत्तर: Exception Generate
व्याख्या: Exception उत्पन्न करने के लिए।
Correct Answer: Generate Exception
Explanation: Used to raise an exception.
398. Namespace का मुख्य उद्देश्य क्या है?
[A] Name Collision रोकना
[B] Increase Memory
[C] Store Sessions
[D] Database Query
398. What is the primary purpose of namespaces?
[A] Prevent Name Collisions
[B] Increase Memory
[C] Store Sessions
[D] Database Query
सही उत्तर: Name Collision रोकना
व्याख्या: Classes/functions के naming conflicts रोकता है।
Correct Answer: Prevent Name Collisions
Explanation: Prevents naming conflicts.
399. use keyword namespaces में किसलिए प्रयोग होता है?
[A] Import Namespace
[B] Delete Namespace
[C] Create Session
[D] Open Database
399. What is the use keyword used for in namespaces?
[A] Import Namespace
[B] Delete Namespace
[C] Create Session
[D] Open Database
सही उत्तर: Import Namespace
व्याख्या: Namespace या class import करने के लिए।
Correct Answer: Import Namespace
Explanation: Imports namespaces or classes.
400. Anonymous Function को और किस नाम से जाना जाता है?
[A] Closure
[B] Generator
[C] Namespace
[D] Trait
400. What is another name for an anonymous function?
[A] Closure
[B] Generator
[C] Namespace
[D] Trait
सही उत्तर: Closure
व्याख्या: Anonymous functions को closures भी कहा जाता है।
Correct Answer: Closure
Explanation: Anonymous functions are also called closures.