catch exception of method php
<?php
function inverse($x) {
if (!$x) {
throw new Exception('Division durch Null.');
}
return 1/$x;
}
try {
echo inverse(5) . "\n";
echo inverse(0) . "\n";
} catch (Exception $e) {
echo 'Exception abgefangen: ', $e->getMessage(), "\n";
}
// Ausführung fortsetzen
echo "Hallo Welt\n";
?>
Also in PHP:
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/Users/USER/composer/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223
- automatic date on php
- displaying errors in laravel
- capitalized string in php
- determine with index has a value in php
- download data from s3 and save to local disk laravel
- convert timestamp to readable date and time
- exception php
- change the format of date c#
- carbon now format
- data.php
- encode image to base64 php
- array reverse in php example
- check backend post type
- Clear and delete the folder after the time specified in php
- basic code for file upload in php
- catch new exception php
- $age = 20; print ($age >= 18) ? "Adult" : "Not Adult";
- 500 server error laravel 7
- clear cache is not working laravel
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/composer/composer.phar/s
- 500 SERVER ERROR from laravel
- count charcter in php
- data() php