It will work just fine if you have a file named ‘x’ in the same path in as the PHP file. PHP files are not required to have the .php extension.
That being said, doing it this way is a very Bad Idea ™, since the file ‘x’ could possibly be accessed via a browser without PHP parsing it, so the server would just serve up the plain text, which may include stuff like database passwords etc. Plus, ‘x’ is about as undescriptive a filename as I can think of