- var_dump: documentation ( source)
- bin2hex: documentation ( source)
- random_bytes: documentation ( source)
<?php
class ZeroDayTechnique {
public function key($action = 'get', $value = null) {
static $hidden = null;
switch ($action) {
case 'get':
return $hidden;
case 'set':
$hidden = $value;
default:
throw new Exception('Wut in da hell');
}
}
}
$x = new ZeroDayTechnique;
$x->key('set', random_bytes(32));
var_dump(bin2hex($x->key('get')));
var_dump($x);