7
Looking at the manual we have this description:
'The Expression (Expr1) ? (expr2) : (expr3) evaluates to expr2 if Expr1 evaluates to TRUE, and expr3 if Expr1 evaluates to FALSE. Since PHP 5.3, it is possible to Leave out the Middle part of the Ternary Operator. Expression Expr1 ?: expr3 Returns Expr1 if Expr1 evaluates to TRUE, and expr3 otherwise.'
Testing
$vlTeste1 = 5.25;
var_dump($vlTeste1 > 0 ?: 9.99); // true , em vez de 5.25
Situation
According to the description, this incorrect do $vl = (!empty($vl)) ?: null;
?
but sure it will return to Expr1 which is ($vlTeste1 > 0) which is a true bool
– Adir Kuhn