3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ZeroDayTechnique { public function key($action = 'get', $value = null) { static $hidden = []; switch ($action) { case 'get': return $hidden[spl_object_hash($this)]; case 'set': $hidden[spl_object_hash($this)] = $value; break; default: throw new Exception('Wut in da hell'); } } } $x = new ZeroDayTechnique; $not_x = new ZeroDayTechnique; $x->key('set', random_bytes(32)); var_dump(bin2hex($x->key('get'))); $not_z->key('set', random_bytes(32)); var_dump(bin2hex($x->key('get'))); var_dump(bin2hex($not_x->key('get'))); var_dump($x);

preferences:
45.19 ms | 402 KiB | 5 Q