1--TEST-- 2Twig supports the ?? operator 3--TEMPLATE-- 4{{ 'OK' ?? 'KO' }} 5{{ null ?? 'OK' }} 6{{ bar ?? 'KO' }} 7{{ baz ?? 'OK' }} 8{{ foo.bar ?? 'KO' }} 9{{ foo.missing ?? 'OK' }} 10{{ foo.bar.baz.missing ?? 'OK' }} 11{{ foo['bar'] ?? 'KO' }} 12{{ foo['missing'] ?? 'OK' }} 13{{ nope ?? nada ?? 'OK' }} 14{{ 1 + nope ?? nada ?? 2 }} 15{{ 1 + nope ?? 3 + nada ?? 2 }} 16--DATA-- 17return ['bar' => 'OK', 'foo' => ['bar' => 'OK']] 18--EXPECT-- 19OK 20OK 21OK 22OK 23OK 24OK 25OK 26OK 27OK 28OK 293 306 31