similar thing is possible with yii2. We have no option to avoid that directly. You may also disallow this in your .htaccess file somehow which is maybe a better place for it.
Yes, i like it too. Let me left .htaccess code here for someone who will look for it:
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
# forbid acccess with /index.php/ in url
RewriteCond %{REQUEST_URI} ^/index\.php/
RewriteRule . - [F]