Artistic Style Formatter is designed for C/C++, C# and Java, but not for PHP. Therefore it produces a wrong result on combination of operators which does not exist in those languages like <? or !== on using option --pad-oper.
I get with option oper checked in Space padding group and using default for Mode the same output as you on running Artistic Style Formatter on a *.php file with your example block.
But I get following also wrong output with option oper checked in Space padding group and using java for Mode:
I think the best solution is to go without option --pad-oper, i.e. do not check oper in Space padding group.
Another solution would be using option oper checked in Space padding group and using java for Mode and run after reformat a Perl regular expression replace with search string (?<=[<=])(?=[?=]) and an empty replace string to remove a single space between operators.
(?<=[<=]) is a positive look-behind checking if left to a space character there is either < or =. And (?=[?=]) is a positive look-ahead checking if after the space character there is either ? or =. Put in the square brackets everything needed to correct every wrong inserted space between operators.
Best regards from an UC/UE/UES for Windows user from Austria
I must note though, ===, !==, and .== are all JavaScript operators(strict compares) and not limited to just PHP, so it might be nice to (sometime in the future) work them into the list of valid operators...
Thanks for the help.
(I mean it, you are an EXCELLENT resource for UltraEdit....)
I am now, on a riff from above, experiencing an additional wee bit of an issue
So, I tried to put this into a Macro...
Seemed to be a simple concept:
Macro:
perform an Artistic Style ordering
perform the perl find, with lookbehind for [\.<=] & lookahead for[?=]
replace with ""
All commands of UltraEdit which open a dialog for the user to choose settings are not available as macro or scripting command with the exception of sort, find, replace, find in files and replace in files.
However, Artistic Style is just an executable installed with UltraEdit in subdirectory GNU. So it is possible to configure a user tool or a project tool to run Artistic Style on active file using as command line:
"UltraEdit program files directory\GNU\astyle.exe"options"%f"
The options to use can be seen in Artistic Style Formatter dialog. They can be also stored in an options file and this options file is specified on command line.
UltraEdit prepends additionally the options --ascii and -sX for default indent width whereby X specifies the number of spaces configured for active file type according to tab stop / indent value setting.
astyle.exe can be run with command line option --help in a command prompt window or from within UltraEdit via Advanced - DOS Command to get help.
The macro can run the configured user or project tool and then runs the Perl regular expression on reloaded file reformatted by Artistic Style.
It is of course also possible to output reformatted contents to console captured by UltraEdit to a new file, making the replaces on this new file, copying the reformatted contents to clipboard, closing new file containing captured output without saving, and pasting reformatted code over original file contents selected before. That would be perhaps better as it makes it possible to undo the changes by using Undo command to undo the paste over entire selected file contents.
Let me know if you need more help on configuring user tool running astyle.exe and UltraEdit macro to run this tool and correct wrong inserted spaces.
Best regards from an UC/UE/UES for Windows user from Austria