Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
2

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

Participant ,
Jan 21, 2023 Jan 21, 2023

I've changed my Dreamweaver settings to be PHP 7+ compliant.

Some simple code like the Null Coalescing Operator ?? throws errors and causes trouble when it it fully valid code.
Please make Dreamweaver fully PHP 7+ compliant.

 

// Old stupid way

$Test = isnull($_POST["PossiblyNullField"])?$_POST["PossiblyNullField"]:"";

// This is the PHP 7+ correct way to make sure that a field that may or may not exist, depending on if the user put data into it doesn't throw an error:

$text = $_POST["PossiblyNullField"]??"";

TOPICS
Error
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Sep 18, 2024 Sep 18, 2024

I finally found a solution to this issue!
I happened to stuble across it somwhere, but here's what to do:
andyd273_0-1726691286055.png

Go to Manage Sites.
Edit the site definition for your website.
Expand Advanced Settings, and then click on PHP.
Change the PHP Version to PHP 7.1 instead of PHP 5.6
Thats it!
Now the error will go away, and you can ?? to your hearts content.

Translate
Community Expert ,
Jan 23, 2023 Jan 23, 2023

Unfortunately DW is in minimal maitenance mode so the odds of it staying up to date like you are asking are slim to none especially since the current version is 8.2. You may need to consider other options.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 24, 2023 Jan 24, 2023

👍 to what @Ben M said.  Dreamweaver has no support for PHP higher than 7.x 

You can disable code Linting from your Preferences panel.   See screenshot.

 

image.png

 

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 10, 2023 Feb 10, 2023

The Null Coalescing Operator was introduced in PHP7, so it's not just an 8+ thing.
I disabled the linting thing, but it doesn't seem to do anything that I can tell.
I just made a small php test page, added this code:
<?php
$t = $nt??"";

?>
The line turns red to show that it has an error, and then stays red even when I turn linting off.
Thanks for the suggestion though!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 18, 2024 Sep 18, 2024

I have the same problem. Why is the bug not fixed by Adobe?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 18, 2024 Sep 18, 2024

I finally found a solution to this issue!
I happened to stuble across it somwhere, but here's what to do:
andyd273_0-1726691286055.png

Go to Manage Sites.
Edit the site definition for your website.
Expand Advanced Settings, and then click on PHP.
Change the PHP Version to PHP 7.1 instead of PHP 5.6
Thats it!
Now the error will go away, and you can ?? to your hearts content.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2024 Sep 18, 2024
quote

Change the PHP Version to PHP 7.1 instead of PHP 5.6

By @andyd273

==============

That's not a solution.  As of this writing (9/18/2024), the current stable release of PHP is version 8.2, released on November 24, 2022.

 

PHP 7.4 is END OF LIFE

It no longer offers more security updates and is affected by multiple vulnerabilities.  If you keep using the PHP 7.4 or lower versions, your site could be vulnerable to potential attack.

 

@Markus30594642ksqb,

Dreamweaver is in minimal maintenance status.  No new features are planned except essential compatibility updates. The PHP versions it supports are sorely out of date and should NOT be used for current development.  😓

 

See this link for more details:

https://community.adobe.com/t5/dreamweaver-discussions/bootstrap-5/m-p/14046967#M225831

 

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 29, 2020 Jan 29, 2020

My server is running PHP 7.2.26. I'm coding in Dreamweaver CC (Ver 19.2.1). I'm using null-coalescing operator on a page, but Dreamweaver is giving me "Syntax Error, Unexpected '?'" as a line error.

My code:

($_SESSION['form_data']['smtpEmailAddress'] ?? "")

It works fine when viewing in a browser. I only get the error in Dreamweaver. Is there a way to get Dreamweaver to accept Null-coalescing Operator? Dreamweaver is currently set to use PHP 7.1. 7.2 is not an option within preferences.

I know I could just ignore the Dreamweaver error, but I do scan my code for errors using the Dreamweaver error indicators. I'd rather fix Dreamweaver than just ignore the error.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 29, 2020 Jan 29, 2020

I do not know of any way to upgrade code hinting and error reporting to PHP 7.2.  I think you'll need to ignore it and wait for a DW update.   See the 2020 Roadmap below.

https://community.adobe.com/t5/dreamweaver/dreamweaver-2020-roadmap/td-p/10885179?page=1

 

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 18, 2024 Sep 18, 2024

The error has still not been corrected.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2024 Sep 18, 2024

Sorry to be the bearer of bad news, but it's very likely it never will be. 

DW has been moved to a minimum development status by Adobe. They only plan to fix security issues, OS compatibility problems, and update third party bolt-on libraries (though they're already very behind on the last one). 

No new features or bug fixes beyond those three elements are planned going forward.

Essentially, the program is on life support for the current userbase, only Adobe knows if or when they'll pull the plug.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 18, 2024 Sep 18, 2024

What am I actually paying a lot of money for this?

Can anyone here recommend another, better program?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2024 Sep 18, 2024

PHP Storm is far better than DW with PHP, but it's definitely not a complete replacement for the other things DW still handles well. There are all kinds of similar software out there, maybe Wappler would work better if you still need the visual tools DW has been terrible at updating over the years.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2024 Sep 18, 2024
LATEST

[Moderator merged topics.]

 

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines