SarkariResultess QA Bank

PHP exception throw कैसे करते हैं? production project में safely कैसे use करें?

Other 0 Views Verified
PHP exception throw कैसे करते हैं? production project में safely कैसे use करें? सही विकल्प चुनें और code/solution को समझें।
Sarkari Result QA Bank
Editorially reviewed exam information

Answer & Explanation

4 Answers
Verified

raise Exception(...)

raise Exception(...)
Additional Explanation
यह विकल्प सही Core PHP solution नहीं है।
Verified Correct Answer

throw new Exception('Something went wrong');

throw new Exception('Something went wrong');
Additional Explanation
throw new Exception exception raise करता है। Production में logging और safe error handling रखें।
Verified

exception.throw(...)

exception.throw(...)
Additional Explanation
यह विकल्प सही Core PHP solution नहीं है।
Verified

throw Exception() only

throw Exception() only
Additional Explanation
यह विकल्प सही Core PHP solution नहीं है।