Dreamweaver PHP Source Format - Incorrect Rewriting of Backslashes
In a .php file, when selecting Edit > Code > Apply Source Formatting, Dreamweaver has a code-breaking bug. It applies incorrect spacing before and after backslashes used in PHP Class namespaces. For instance, this is what a namespace looks like after formatting (two examples: one without a backslash to begin the namespace and one with):
<?php
use Path\ ToMy\ Namespaced\ PHPClass;
// Fully qualified name
use\ FullyQualified\ Namespaced\ PHPClass;
Before PHP version 8, this didn’t seem to affect the parser at all, so I never worried about it. After I updated my local environment to PHP 8.1, it throws a syntax error whenever there is a space after a backslash, or no space after a reserved keyword (use, new, return). This is probably a strict-mode condition that can be turned off, but that shouldn’t be necessary.
In all instances, it just seems like incorrect behavior to ever change source code in this way. Backslashes have a very important role in PHP and should not be affected by source formatting. Is there a way to change this behaviour in Dreamweaver, or is this simply a bug that Adobe needs to fix?
