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_x->key('set', random_bytes(32)); var_dump(bin2hex($x->key('get'))); var_dump(bin2hex($not_x->key('get'))); var_dump($x);
based on 6ZlFR
Output for 7.2.0
string(64) "b44218a67623e1dd65f2b05b3a1f4bfaa61daada79dec545711988f210dc9ca7" string(64) "b44218a67623e1dd65f2b05b3a1f4bfaa61daada79dec545711988f210dc9ca7" string(64) "759a8445d6b026a9a7217adf1e4e0e21e08ec593b7c6b290fa321d7d599ad8d6" object(ZeroDayTechnique)#1 (0) { }
Output for 7.1.10
string(64) "86e692b5c4673fa333883f432e97d6c4650e6741a49eda27fbf6efcefeae3344" string(64) "86e692b5c4673fa333883f432e97d6c4650e6741a49eda27fbf6efcefeae3344" string(64) "db45b0afcb757b7290773d685f24ecf5b8c3a031df462a7b597ee2c4b240e97f" object(ZeroDayTechnique)#1 (0) { }
Output for 7.1.7
string(64) "5a19b31b66b77e558d2c048b0c7eb2362532a19d236a27e1f5bc1d76d23a25b0" string(64) "5a19b31b66b77e558d2c048b0c7eb2362532a19d236a27e1f5bc1d76d23a25b0" string(64) "3ad0d731a94cf35b5e59efb25d90d8d366fb295616b4d616c99dcee5a01fe079" object(ZeroDayTechnique)#1 (0) { }
Output for 7.1.6
string(64) "7c955d044877ab885b163568034651e4721f767b2b999081f5521d35a5c48c3e" string(64) "7c955d044877ab885b163568034651e4721f767b2b999081f5521d35a5c48c3e" string(64) "bfa52004093d099739f78e359db8a4f0878ce8b82f093b861ae938809e4cef03" object(ZeroDayTechnique)#1 (0) { }
Output for 7.1.5
string(64) "c38d970eae5e09a2ff195ea5062f8f67df73999536ac4ccba9c6a21b16ad6c76" string(64) "c38d970eae5e09a2ff195ea5062f8f67df73999536ac4ccba9c6a21b16ad6c76" string(64) "9ecacf18bb8ff63479fdf043431a4a696470c582bcb34a7429c0aadef9e8fcf5" object(ZeroDayTechnique)#1 (0) { }
Output for 7.1.0
string(64) "94aa06796da3c6d795cef61139e54993311dd97aae6d4d28ffd601a84728ff2e" string(64) "94aa06796da3c6d795cef61139e54993311dd97aae6d4d28ffd601a84728ff2e" string(64) "06ea25e0e5f141fa9f75c6c870d7687a1774010d8473a7c0940bc4564bda7ab2" object(ZeroDayTechnique)#1 (0) { }
Output for 7.0.20
string(64) "240e2ee766a4458384223f227e3113376e2a524f41135e60286abc11000c35b0" string(64) "240e2ee766a4458384223f227e3113376e2a524f41135e60286abc11000c35b0" string(64) "294fd4689be1da0f0f5afe86821beed82698db3d1d4e5dcede2bcf232bf0a92c" object(ZeroDayTechnique)#1 (0) { }
Output for 7.0.6
string(64) "31639e0f81dee8e5219eaf72d0d80df5f194ffa806339100f06bd58486f1bdd8" string(64) "31639e0f81dee8e5219eaf72d0d80df5f194ffa806339100f06bd58486f1bdd8" string(64) "0d9c270486bc8ececd24d15893508c2573225c37e1b2df5f438e29b98bd3bf93" object(ZeroDayTechnique)#1 (0) { }
Output for 7.0.5
string(64) "60055726266b04606a94ae3a422ac70a34c6e5baf97ae8244d0a40957082ea4d" string(64) "60055726266b04606a94ae3a422ac70a34c6e5baf97ae8244d0a40957082ea4d" string(64) "d7fda0989914acf5d019b2ee6a3a02164af50db5988d5dc5c1aa53a7ac06e294" object(ZeroDayTechnique)#1 (0) { }
Output for 7.0.4
string(64) "292400d1299ce412943c3f0ea65f71c40e561a64b7fe14a436eb8c948730b846" string(64) "292400d1299ce412943c3f0ea65f71c40e561a64b7fe14a436eb8c948730b846" string(64) "08291f6a553ad421bec96f3d904ef337c96f52e968c61c00e63db311947f8715" object(ZeroDayTechnique)#1 (0) { }
Output for 7.0.3
string(64) "f28aba73f9121b3e5f38b4e802016176c898ecf6c4c2e3dbb47611e993db0361" string(64) "f28aba73f9121b3e5f38b4e802016176c898ecf6c4c2e3dbb47611e993db0361" string(64) "c5cd13a9afa5f1b4700ff04ad1dadbd6e618127a46a3a598d782ba035b5e0bb5" object(ZeroDayTechnique)#1 (0) { }
Output for 7.0.2
string(64) "13e004de8ac89d59dd71e0c2cff2de33b6449e28bc4f0ec63f16ec441b8ba5f3" string(64) "13e004de8ac89d59dd71e0c2cff2de33b6449e28bc4f0ec63f16ec441b8ba5f3" string(64) "1855667c3e4bc8aae559f616c956545da29bf92de6b9117ad2025700a575638b" object(ZeroDayTechnique)#1 (0) { }
Output for 7.0.1
string(64) "202d2e1099814f78a5776603ff2d43adacd07b10bacfaf01a5e3013d5de93111" string(64) "202d2e1099814f78a5776603ff2d43adacd07b10bacfaf01a5e3013d5de93111" string(64) "a9a52c2d98a0bbbb58e606782e1ddee141c20dc6efe31b4bd68fca0665e0efdf" object(ZeroDayTechnique)#1 (0) { }
Output for 7.0.0
string(64) "7f992bb62361215bb00dea2fb62a6057df63c4726c1359bb2f11e85cd96703f8" string(64) "7f992bb62361215bb00dea2fb62a6057df63c4726c1359bb2f11e85cd96703f8" string(64) "6c4688ff4ce73ffa725006171c76f1e67fb66a2f8074f84711f3a9c070e27053" object(ZeroDayTechnique)#1 (0) { }
Output for 5.4.0 - 5.6.28
Fatal error: Call to undefined function random_bytes() in /in/NsBcp on line 21
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/NsBcp on line 5
Process exited with code 255.