THROW EXPECTION PHP
function inverse($x) {
if (!$x) {
throw new Exception('Division by zero.');
}
return 1/$x;
}function inverso($x) {
if (!$x) {
throw new Exception('Zero division.');
}
return 1/$x;
}
try {
echo inverso(5) . "\n";
echo inverso(0) . "\n";
} catch (Exception $e) {
echo 'and the error is: ', $e->getMessage(), "\n";
}
Also in PHP:
- body field yml drupal config
- diplay php error
- command not found: laravel
- clearview cache laravel
- count number of characters php
- date('I')
- AWS HTTP error: SSL operation failed with code 1.
- check if string contains word php
- PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.2.0". You are running 5.6.40
- PHP if exists string
- It is possible to perform an HTTPS redirect using PHP code as well as writing PHP code to prevent the browser from caching your we
- find position of character in string php
- display current data php
- Shorten long numbers to K/M/B?
- Codeigniter count query results
- _______ is used to execute laravel project
- How to see if there is a - in a string in php
- Wordpress login page Background Image / Logo Image
- /phpspreadsheet 1.15.0 requires ext-dom * centos
- artisan seed
- check length of a string in php
- Allowed memory size of 1610612736 bytes exhausted laravel 8
- PHP Warning
- create folder php en linux centos 7