Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library.php:
- ------------
- <?php
- function foo() {
- }
- ?>
- error.php:
- ----------
- <?php
- error_reporting(E_ALL);
- require_once 'library.php';
- echo 'I will deal with a 500 error and show a pretty error message';
- ?>
- test.php:
- ---------
- <?php
- error_reporting(E_ALL);
- require_once 'library.php';
- $test = 1; // Try all 3 tests
- if ($test == 1) {
- header('Foo: Bar');
- flush();
- echo 'I worked absolutely fine';
- }
- if ($test == 2) {
- header('Foo : Bar'); // Only change
- echo 'I went wrong but did so gracefully';
- }
- if ($test == 3) {
- header('Foo : Bar');
- flush(); // Only change
- echo 'I fell to pieces in a horrendous and nonsensical way';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement