PHP 8.5.0 Alpha 4 available for testing

Voting

: five plus zero?
(Example: nine)

The Note You're Voting On

rvwoens at gmail dot com
2 years ago
Note that ?? has a low priority, so this can lead to unexpected results:

$a=[];
$a['aa']??'not set'
--> not set (as expected)

but
"lets see if it is set".$a['aa']??'not set'
--> notice; undefined index aa
--> lets see if it is set

so you need to use parenthesis
"lets see if it is set".($a['aa']??'not set')

<< Back to user notes page

To Top