Skip to main content
Participant
May 15, 2026 9:00 AM UTC
Open for Voting

Syntax check for operator ?? in PHP

Function syntax check for PHP code working nnot correctly for this syntax:

$rabat_rzeczywisty = ($wynik['rabatRzeczywisty'] ?? 0);

 

operator ??

    2 replies

    Community Expert
    May 20, 2026 12:34 PM UTC

    ​@mariusz_3612 as ​@Nancy OShea  mentioned, make sure the PHP version is set to PHP 7 or higher so the `??` operator is properly supported.

    Paradoxically, Dreamweaver’s JavaScript parser is still a bit behind regarding some modern JS syntaxes and may incorrectly flag lines such as:

     

    const rabatRzeczywisty = wynik['rabatRzeczywisty'] ?? 0;

     

    Translate
    Nancy OShea
    Community Expert
    Community Expert
    May 17, 2026 9:04 PM UTC

    The ?? (null coalescing) operator was introduced in PHP 7.0

    Which version of PHP is selected in your DW Preferences?

     

     

     

     

    Translate
    Nancy O'Shea— Product User & Community Expert