Better handling php file editing

I can’t at all edit php files in Wordpress without getting errors even though there are no errors, have to edit them in Atom “not a problem using Atom” but would like to be able to edit them in PG. I have the php files for Wordpress when I need to edit special code. Am I the only one having that problem?