https://github.com/spameri/arraycatch
Catch exceptions of undefined array fields instead of crash.
https://github.com/spameri/arraycatch
Last synced: about 1 year ago
JSON representation
Catch exceptions of undefined array fields instead of crash.
- Host: GitHub
- URL: https://github.com/spameri/arraycatch
- Owner: Spameri
- Created: 2017-04-05T12:01:30.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-05T12:04:03.000Z (about 9 years ago)
- Last Synced: 2025-06-21T10:07:08.921Z (about 1 year ago)
- Language: PHP
- Size: 1000 Bytes
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ArrayCatch
Catch exceptions of undefined array fields instead of crash.
## Usage
```php?start_inline=true
set_error_handler('handleError');
$data = [];
try {
echo $data['test'];
} catch (ArrayFieldNotSet $exception) {
echo $exception->getMessage();
}
restore_error_handler();
```