PHP code example of fredemmott / hack-error-suppressor

1. Go to this page and download the library: Download fredemmott/hack-error-suppressor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fredemmott / hack-error-suppressor example snippets



use FredEmmott\HackErrorSuppressor;

$it = new HackErrorSuppressor();
$it->enable();
call_some_hack_code();
$it->disable();



use FredEmmott\ScopedHackErrorSuppressor;

function do_unsafe_stuff() {
  $suppressor = new ScopedHackErrorSuppressor();
  call_some_hack_code(); // this works
}

do_unsafe_stuff();
call_some_hack_code(); // this fails, as we're out of scope

FredEmmott\HackErrorSuppressor::allowRealRequestsAgainstBrokenCode();