Skip to main content
Inspiring
October 13, 2022
Question

Dreamweaver shows an error for the Null Coalescing Operator (??), a PHP 7 feature

  • October 13, 2022
  • 1 reply
  • 194 views

Not sure if it's a bug report or a question.
I use the null coalescing operator in a few of my pages to easily check if a variable exists before using it in order to easily avoid "variable does not exist" errors. Usually POST fields.

I set Dreamweaver to PHP 7 under preferences, but it still flags those lines as having errors.
Is there a way to tell it that the ?? is valid?

 

Explanation of the Null Coalescing Operator

https://www.phptutorial.net/php-tutorial/php-null-coalescing-operator/

    This topic has been closed for replies.

    1 reply

    BenPleysier
    Community Expert
    Community Expert
    October 13, 2022

    This must be a bug in Dreamweaver.

     

    Not sure if this will be corrected in a future version. But there are a number of possible workarounds.

    1. Ignore the error message

    2. Turn off linting

    3. Use the ternary operator

    4. Use a decent IDE

     

     

    Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
    andyd273Author
    Inspiring
    October 14, 2022

    Yeah, I've been ignoring it for a long time. 
    It's not a huge deal, I just got thinking about how DW is supposed to support PHP 7 features now, and noticed that it wasn't working the way that I thought it should.
    Wappler looks interesting, but it costs about as much per month as what the creative cloud subscription does for all apps... It must be pretty good to be worth that 🙂

    I'll keep it in mind though