2
0
mirror of https://github.com/boostorg/website.git synced 2026-01-22 17:52:30 +00:00
Files
website/common/code/test/tests/bootstrap/suppress-errors.phpt
Daniel James 5dfc5183e0 Fix a couple of error handling issues
- Use `http_response_code` as it's a bit more robust than using `header`.
- Check errors against `error_reporting()`, so that error checks can be
  ignored when appropriate.
2017-02-09 13:28:45 +00:00

17 lines
350 B
PHP

<?php
/* Test suppressing errors by using '@', or by setting 'error_reporting'. */
require_once(__DIR__.'/../../../bootstrap.php');
$path = __DIR__."/does-not-exist.txt";
error_reporting(-1);
assert(!@file_get_contents($path));
error_reporting(0);
assert(!file_get_contents($path));
error_reporting(E_ERROR);
assert(!file_get_contents($path));