Skip to main content
Participant
May 15, 2026

Syntax check for operator ?? in PHP

  • May 15, 2026
  • 2 replies
  • 30 views

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

    @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;

     

    Nancy OShea
    Community Expert
    Community Expert
    May 17, 2026

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

    Which version of PHP is selected in your DW Preferences?

     

     

     

     

    Nancy O'Shea— Product User & Community Expert