Is there a way to catch an Exception without having to create a variable?

Starting with PHP 8, it is possible to use a non-capturing catch. This is the relevant RFC, which was voted favourably 48-1. Now it will be possible to do something like this: try { readFile($file); } catch (FileDoesNotExist) { echo “File does not exist”; } catch (UnauthorizedAccess) { echo “User does not have the appropriate … Read more