3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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);
based on 454gF
Output for 7.2.0
string(64) "42340149c7a293302fd7b7b23f3f07356e5680bb0c4faddb2ee3bf56d597766a" Notice: Undefined variable: not_z in /in/6ZlFR on line 25 Fatal error: Uncaught Error: Call to a member function key() on null in /in/6ZlFR:25 Stack trace: #0 {main} thrown in /in/6ZlFR on line 25
Process exited with code 255.
Output for 7.1.10
string(64) "5bb4823be724b7b08fa543bb030c26531c9ac3b4fdc9f3378cb60ae3f3eb9cb8" Notice: Undefined variable: not_z in /in/6ZlFR on line 25 Fatal error: Uncaught Error: Call to a member function key() on null in /in/6ZlFR:25 Stack trace: #0 {main} thrown in /in/6ZlFR on line 25
Process exited with code 255.
Output for 7.1.7
string(64) "37fe1137919082dce800fa9196b2f5af3c9cecfae056dbda66018ee42ba0ac76" Notice: Undefined variable: not_z in /in/6ZlFR on line 25 Fatal error: Uncaught Error: Call to a member function key() on null in /in/6ZlFR:25 Stack trace: #0 {main} thrown in /in/6ZlFR on line 25
Process exited with code 255.
Output for 7.1.6
string(64) "a565ec6e607e778aaca160db2577c14d4b5eb53242cc0d3f2fc7a6fc713d45f4" Notice: Undefined variable: not_z in /in/6ZlFR on line 25 Fatal error: Uncaught Error: Call to a member function key() on null in /in/6ZlFR:25 Stack trace: #0 {main} thrown in /in/6ZlFR on line 25
Process exited with code 255.
Output for 7.1.5
string(64) "1a3eb8ae6fd722a716914660c36a2ce12ca69ff340c5edafb1d1523327db1e4c" Notice: Undefined variable: not_z in /in/6ZlFR on line 25 Fatal error: Uncaught Error: Call to a member function key() on null in /in/6ZlFR:25 Stack trace: #0 {main} thrown in /in/6ZlFR on line 25
Process exited with code 255.
Output for 7.1.0
string(64) "3dc02ff989d825d1959b76f049fa4851392b36168eded770d76b2646585660af" Notice: Undefined variable: not_z in /in/6ZlFR on line 25 Fatal error: Uncaught Error: Call to a member function key() on null in /in/6ZlFR:25 Stack trace: #0 {main} thrown in /in/6ZlFR on line 25
Process exited with code 255.
Output for 7.0.20
string(64) "73498860d38893495c75569108f9e38c35132e24d60198dcb3f6e19307564a08" Notice: Undefined variable: not_z in /in/6ZlFR on line 25 Fatal error: Uncaught Error: Call to a member function key() on null in /in/6ZlFR:25 Stack trace: #0 {main} thrown in /in/6ZlFR on line 25
Process exited with code 255.
Output for 7.0.6
string(64) "8d45ea1874a1a853471a4e825b307ab35d6f69e8f340956bd3677af1fd667962" Notice: Undefined variable: not_z in /in/6ZlFR on line 25 Fatal error: Uncaught Error: Call to a member function key() on null in /in/6ZlFR:25 Stack trace: #0 {main} thrown in /in/6ZlFR on line 25
Process exited with code 255.
Output for 7.0.5
string(64) "10ded2f0a2b1e59447e4da96fa6b4496db8213e28c6ce32942249d127abe161f" Notice: Undefined variable: not_z in /in/6ZlFR on line 25 Fatal error: Uncaught Error: Call to a member function key() on null in /in/6ZlFR:25 Stack trace: #0 {main} thrown in /in/6ZlFR on line 25
Process exited with code 255.
Output for 7.0.4
string(64) "bc8e8c774989eced19b5c42f2299afe7486904be15d4d05757a1305b3f211c63" Notice: Undefined variable: not_z in /in/6ZlFR on line 25 Fatal error: Uncaught Error: Call to a member function key() on unknown in /in/6ZlFR:25 Stack trace: #0 {main} thrown in /in/6ZlFR on line 25
Process exited with code 255.
Output for 7.0.3
string(64) "02b574ab97a9c2c3f0b2f11d8dfeb6a27111898900e346fe093b11d9c1c818d3" Notice: Undefined variable: not_z in /in/6ZlFR on line 25 Fatal error: Uncaught Error: Call to a member function key() on unknown in /in/6ZlFR:25 Stack trace: #0 {main} thrown in /in/6ZlFR on line 25
Process exited with code 255.
Output for 7.0.2
string(64) "2058360bedf7b25759c2edf05a48ccd90956e158cb41f319919bc1df4c84caff" Notice: Undefined variable: not_z in /in/6ZlFR on line 25 Fatal error: Uncaught Error: Call to a member function key() on unknown in /in/6ZlFR:25 Stack trace: #0 {main} thrown in /in/6ZlFR on line 25
Process exited with code 255.
Output for 7.0.1
string(64) "b917d6c7274dd12c3ac725695d186056e970cb50d9a670318564aae7814be227" Notice: Undefined variable: not_z in /in/6ZlFR on line 25 Fatal error: Uncaught Error: Call to a member function key() on unknown in /in/6ZlFR:25 Stack trace: #0 {main} thrown in /in/6ZlFR on line 25
Process exited with code 255.
Output for 7.0.0
string(64) "f21e48f4c8b30f7ce0c31ce7e79aefa6a3c43322c79c621c795752efa374aeb0" Notice: Undefined variable: not_z in /in/6ZlFR on line 25 Fatal error: Uncaught Error: Call to a member function key() on unknown in /in/6ZlFR:25 Stack trace: #0 {main} thrown in /in/6ZlFR on line 25
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Call to undefined function random_bytes() in /in/6ZlFR on line 21
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/6ZlFR on line 5
Process exited with code 255.