I am having trouble with the formatting of the PHP file with a closing tag within a string.
The next part of the file (after the string) becomes incorrectly formatted.
$msg .= "<?php defined('PATH') || exit('No direct script access allowed'); ?/> \n\n";
The result on save is:
// Only add protection to php files
if ($this->fileExtension === 'php')
{
$msg .= "<?php defined('PATH') || exit('No direct script access allowed'); ?> \n\n";
}
}
My code is right in the source (between the code tags) but it renders incorrectly on the page and I don't seem to be able to fix it.
The rest of the file is similarly incorrectly formatted. If I then save several more times, code compresses up onto the previous line. Which if there is a comment present, makes the code non-executable.
I am using the latest version of PHP Tools for VS Code.