Read up on "greedy" and "lazy" Regular Expression. The First segment of your RewriteRule is lazy (which is better than greedy); however it is still refined enough to know exactly what it's looking for.
Greedy would require a significant amount of memory. You might want to make it [QSA,NC,L]
.
QSA will add any ?query=strings
, the NC forces the url to ignore the case, and L means it's the last rewrite rule to check until the next rewrite condition.
Wrapping it in a IFModule is pretty important, don't want server 500 errors if Rewrite isn't working right. The RewriteBase will tell it to get it's sought after files from the root of the folder the .htaccess file is sitting in.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^\.]+)$ $1.php [QSA,NC,L]
</IfModule>