3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class cywm528 { function __destruct() { echo 'cywm528.'; } } echo 'hi, '; $obj = unserialize('O:7:"cywm528":'); // $obj = unserialize('O:7:"cywm528":1:{}'); // $arr = unserialize('a:1:{O:7:"cywm528":0:{}'); // $arr = unserialize('a:2:{O:7:"cywm528":0:{};s:7:"cywm528";}'); echo ' ok!';
Output for 7.0.20, 7.1.5 - 7.2.0
hi, Warning: Bad unserialize data in /in/32q6P on line 11 Notice: unserialize(): Error at offset 12 of 14 bytes in /in/32q6P on line 11 ok!
Output for 7.1.0
hi, Notice: unserialize(): Error at offset 17 of 14 bytes in /in/32q6P on line 11 cywm528. ok!
Output for 5.3.20 - 7.0.6
hi, cywm528. Notice: unserialize(): Error at offset 17 of 14 bytes in /in/32q6P on line 11 ok!