CDE
This commit is contained in:
parent
518da4a923
commit
764da6cbbb
6144 changed files with 83610 additions and 11 deletions
4
Task/Exceptions/PHP/exceptions-1.php
Normal file
4
Task/Exceptions/PHP/exceptions-1.php
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
class MyException extends Exception
|
||||
{
|
||||
// Custom exception attributes & methods
|
||||
}
|
||||
4
Task/Exceptions/PHP/exceptions-2.php
Normal file
4
Task/Exceptions/PHP/exceptions-2.php
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
function throwsException()
|
||||
{
|
||||
throw new Exception('Exception message');
|
||||
}
|
||||
5
Task/Exceptions/PHP/exceptions-3.php
Normal file
5
Task/Exceptions/PHP/exceptions-3.php
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
try {
|
||||
throwsException();
|
||||
} catch (Exception $e) {
|
||||
echo 'Caught exception: ' . $e->getMessage();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue