[ PHP Programming MCQS ]
झारखंड में आयोजित होने वाली JPSC, JSSC, JET, झारखंड पुलिस भर्ती परीक्षा आदि के लिए उपयोगी सामान्य अध्ययन।
[ PHP Programming MCQS ]
Useful GK for JPSC, JSSC, JET, Jharkhand Police and other exams.
441. PHP Code: echo array_product([2,3,4]); Output क्या होगा?
[A] 9
[B] 12
[C] 24
[D] 18
441. PHP Code: echo array_product([2,3,4]); What is the output?
[A] 9
[B] 12
[C] 24
[D] 18
सही उत्तर: 24
व्याख्या: 2 × 3 × 4 = 24
Correct Answer: 24
Explanation: 2 × 3 × 4 = 24
442. Closure में use keyword का उद्देश्य क्या है?
[A] Outer Variable Access
[B] Namespace Import
[C] Trait Import
[D] Session Access
442. What is the purpose of use keyword in Closures?
[A] Outer Variable Access
[B] Namespace Import
[C] Trait Import
[D] Session Access
सही उत्तर: Outer Variable Access
व्याख्या: Anonymous function के अंदर external variables उपयोग करने के लिए।
Correct Answer: Outer Variable Access
Explanation: Allows access to external variables.
443. PHP में Arrow Function किस version में introduce हुआ?
[A] PHP 7.2
[B] PHP 7.3
[C] PHP 7.4
[D] PHP 8.0
443. In which version were Arrow Functions introduced?
[A] PHP 7.2
[B] PHP 7.3
[C] PHP 7.4
[D] PHP 8.0
सही उत्तर: PHP 7.4
व्याख्या: Short closure syntax प्रदान करता है।
Correct Answer: PHP 7.4
Explanation: Provides short closure syntax.
444. Arrow Function का syntax कौन-सा है?
[A] function(){}
[B] fn() =>
[C] lambda()
[D] arrow()
444. Which is the syntax of an Arrow Function?
[A] function(){}
[B] fn() =>
[C] lambda()
[D] arrow()
सही उत्तर: fn() =>
व्याख्या: PHP 7.4 में introduced concise syntax।
Correct Answer: fn() =>
Explanation: Concise syntax introduced in PHP 7.4.
445. यदि दो Traits में same method हो तो conflict resolution के लिए क्या उपयोग किया जाता है?
[A] insteadof
[B] override
[C] extends
[D] resolve
445. What is used to resolve trait method conflicts?
[A] insteadof
[B] override
[C] extends
[D] resolve
सही उत्तर: insteadof
व्याख्या: Trait conflicts resolve करने के लिए।
Correct Answer: insteadof
Explanation: Used for trait conflict resolution.
446. Trait method alias बनाने के लिए कौन-सा keyword प्रयोग होता है?
[A] as
[B] alias
[C] use
[D] rename
446. Which keyword creates an alias for a trait method?
[A] as
[B] alias
[C] use
[D] rename
सही उत्तर: as
व्याख्या: Method का नया नाम देने के लिए।
Correct Answer: as
Explanation: Used to assign a new method name.
447. Composer में dependencies किस file में define होती हैं?
[A] composer.lock
[B] composer.json
[C] package.json
[D] config.php
447. In which file are Composer dependencies defined?
[A] composer.lock
[B] composer.json
[C] package.json
[D] config.php
सही उत्तर: composer.json
व्याख्या: Project dependencies composer.json में होती हैं।
Correct Answer: composer.json
Explanation: Dependencies are defined in composer.json.
448. composer install command क्या करता है?
[A] Dependencies Install करता है
[B] Dependencies Delete करता है
[C] Composer Remove करता है
[D] PHP Upgrade करता है
448. What does composer install do?
[A] Installs Dependencies
[B] Deletes Dependencies
[C] Removes Composer
[D] Upgrades PHP
सही उत्तर: Dependencies Install करता है
व्याख्या: composer.lock/composer.json से packages install करता है।
Correct Answer: Installs Dependencies
Explanation: Installs packages from composer files.
449. composer require command का उपयोग किसलिए होता है?
[A] Package Add करने के लिए
[B] Package Remove करने के लिए
[C] Package Rename करने के लिए
[D] Package Compile करने के लिए
449. What is composer require used for?
[A] Add Package
[B] Remove Package
[C] Rename Package
[D] Compile Package
सही उत्तर: Package Add करने के लिए
व्याख्या: नई dependency जोड़ता है।
Correct Answer: Add Package
Explanation: Adds a new dependency.
450. Laravel में Dependency Injection का मुख्य लाभ क्या है?
[A] Loose Coupling
[B] Tight Coupling
[C] More Memory
[D] More Queries
450. What is the main benefit of Dependency Injection in Laravel?
[A] Loose Coupling
[B] Tight Coupling
[C] More Memory
[D] More Queries
सही उत्तर: Loose Coupling
व्याख्या: Code maintainability और testing बेहतर होती है।
Correct Answer: Loose Coupling
Explanation: Improves maintainability and testing.