SarkariResultess QA Bank

PHP arrow function कैसे लिखते हैं? को secure तरीके से कैसे implement करें?

Other 0 Views Verified
PHP arrow function कैसे लिखते हैं? को secure तरीके से कैसे implement करें? सही विकल्प चुनें और code/solution को समझें।
Sarkari Result QA Bank
Editorially reviewed exam information

Answer & Explanation

4 Answers
Verified

$double = arrow($x) => $x*2;

$double = arrow($x) => $x*2;
Additional Explanation
यह विकल्प सही Core PHP solution नहीं है।
Verified

$double = lambda $x: $x*2;

$double = lambda $x: $x*2;
Additional Explanation
यह विकल्प सही Core PHP solution नहीं है।
Verified

fn => ($x) { $x*2; }

fn => ($x) { $x*2; }
Additional Explanation
यह विकल्प सही Core PHP solution नहीं है।
Verified Correct Answer

$double = fn($x) => $x * 2;

$double = fn($x) => $x * 2;
Additional Explanation
fn() => expression short closure syntax है। User input को trust न करें; validation, escaping और prepared statements context के अनुसार उपयोग करें।