PHP VERSION: 8.2.18

uniform_variable_syntax_ternary_example.php

<?php

class Foo
{
    public static 
$test 'Test';
    public function 
bar()
    {
        return 
self::$test;
    }
}

$a = new Foo();
echo (
$a ?: $b)->bar();

Output


Test
SOURCE CODE