PHP VERSION: 7.0.26

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