Avatar ·

Can I catch a warning in PHP using try/catch?

Hi everyone! I'm new to PHP and ran into a problem. I'm writing a script that reads a CSV file and processes data. Sometimes the file is corrupted or contains invalid data — for example, one of the fields expects a number, but there's a string. PHP issues a warning, and the script continues running, but with garbage data. I want to catch such situations and handle them gracefully, for example, log the error and skip the row. I tried wrapping the problematic code in try/catch, but it doesn't work. Here's an example: ```php ge