List of Double question mark (??) operator mean in PHP
<?php
echo $x ?? 6 ?? 32; //$a is not set
?>
output : 6
<?php
$b = 54;
echo $a ?? $b ?? 5;//$a is not set
?>
output : 54
<?
$foo = $bar ?? 'something';
$foo = isset($bar) ? $bar : 'something';
echo $foo;
?>
output : something
<!DOCTYPE html>
<html>
<head>
<title>double question mark (??) operator mean in PHP</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<br>
<br>
<div class="text-center">
<h1>Double question mark (??) operator mean in PHP</h1>
</div>
<br>
<br>
<div class="well">
<?php
//$a is not set
echo $x ?? 6 ?? 32;
echo "<br>";
echo "<br>";
//$a is not set
$b = 54;
echo $a ?? $b ?? 5;
echo "<br>";
echo "<br>";
$foo = $bar ?? 'something';
$foo = isset($bar) ? $bar : 'something';
echo $foo;
?>
</div>
<br>
</div>
</body>
</html>