Any inconvenience of the declaration of variables online? how Hello". ($ name = "Jimmy")

Is there a problem of inconvenience / incompatibility, if I declare the variable online, how?

$ path = "FolderName / SubFolder /". ($ file = "smth.txt");

if (file_exists ($ file))
....