catch new exception php
function inverse($x) {
if (!$x) {
throw new Exception('Division by zero.');
}
return 1/$x;
}try
{
// Some code...
}
catch(AError | BError $e)
{
// Handle exceptions
}
catch(Exception $e)
{
// Handle the general case
}
Also in PHP:
- array length php
- check if substring php
- exception php
- api newslater with php
- clear laravel component cache
- How do I clear laravel cache online?
- echo php dropdown from db and save it in a db
- check if is key in array php
- date formate with timestamp php
- Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0". when php is 7.4
- disable errors php
- composer remove laravel
- cronjob cakephp
- curent date and time php
- ReflectionException: Class Magento\Framework\App\Http\Interceptor does not exist in
- check if a text include a word php
- check if is in a string php
- Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 126976 bytes) in
- add days to current date php
- control string length php
- defaultStringLength laravel
- cache laravel example
- character lenght php
- date in php in dats