SarkariResultess QA Bank

PHP null coalescing operator कैसे लिखते हैं? इसका working code example क्या है?

Other 0 Views Verified
PHP null coalescing operator कैसे लिखते हैं? इसका working code example क्या है? सही विकल्प चुनें और code/solution को समझें।
Sarkari Result QA Bank
Editorially reviewed exam information

Answer & Explanation

4 Answers
Verified Correct Answer

$name = $_GET['name'] ?? 'Guest';

$name = $_GET['name'] ?? 'Guest';
Additional Explanation
?? null/undefined array key fallback देता है।
Verified

$name = coalesce($_GET['name'],'Guest');

$name = coalesce($_GET['name'],'Guest');
Additional Explanation
यह विकल्प सही Core PHP solution नहीं है।
Verified

$name = $_GET['name'] ??: 'Guest';

$name = $_GET['name'] ??: 'Guest';
Additional Explanation
यह विकल्प सही Core PHP solution नहीं है।
Verified

$name = $_GET['name'] ?: 'Guest';

$name = $_GET['name'] ?: 'Guest';
Additional Explanation
यह विकल्प सही Core PHP solution नहीं है।