Skip to content

Instantly share code, notes, and snippets.

@igorw
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save igorw/4485603500b4bf6511e1 to your computer and use it in GitHub Desktop.
Save igorw/4485603500b4bf6511e1 to your computer and use it in GitHub Desktop.

kayladnls/machine-forget

A simple machine forgetting library.

Example

Here is an example of how you can instruct the machine to forget the answer:

<?
use function kayladnls\machine_forget;

$answer = 42;
machine_forget($answer);
var_dump($answer);

?>

WHAT IS THE ANSWER? WHAT WAS IT? WHAT IS IT?!

{"name": "kayladnls/machine-forget", "description": "A simple machine forgetting library.", "license": "MIT"}
<?php
namespace kayladnls;
function machine_forget(&$data) {
$data = null;
}
@scoates
Copy link

scoates commented Sep 30, 2014

@kix
Copy link

kix commented Sep 30, 2014

@GeeH
Copy link

GeeH commented Sep 30, 2014

Needed to prevent recovery through expensive data recovery companies.

function machine_forget(&$data, $scrub = false) {
    if ($scrub) {
        $data = json_decode(file_get_contents('http://baconipsum.com/api/?type=meat-and-filler'))[0];
    }
    $data = null;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment