When using Cloud IDE, you'll face issue when editing PHP files because of the auto-formatting that occurs when you begin writing PHP code. The auto-formatting will often indent lines and break up PHP code further down in the file and cause issues, and you have to undo these changes.
You can turn-off this auto indentation feature under Settings -> Preferences -> Editor -> Auto Indent.
Set it to none and then save your changes, using the method based on your operating system:
macOS: Press Command+S.
Windows: Press Control+S.
Linux: Press Control+S.
The preferences are usually apparent immediately. If not, then please close the IDE and start it again.