3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { var $one = "111"; function __construct() { echo "construct";} function __destruct() { echo "destruct".$this->one;} function __wakeup() { echo "wakeup";} } //$at = new A(); $x = 'O:1:"A":1:{s:3:"one";s:13:"__construct()";}'; echo $x; $u = unserialize($x); var_dump($u); ?>
based on 1A5Qt
Output for 5.1.3 - 5.6.28, 7.0.0 - 7.1.0
O:1:"A":1:{s:3:"one";s:13:"__construct()";}wakeupobject(A)#1 (1) { ["one"]=> string(13) "__construct()" } destruct__construct()
Output for hhvm-3.12.0
O:1:"A":1:{s:3:"one";s:13:"__construct()";}wakeupobject(A)#1 (1) { ["one"]=> string(13) "__construct()" }
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.0 - 5.1.2
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/YtPNu on line 2 O:1:"A":1:{s:3:"one";s:13:"__construct()";}wakeupobject(A)#1 (1) { ["one"]=> string(13) "__construct()" } destruct__construct()
Output for 4.3.0 - 4.4.9
O:1:"A":1:{s:3:"one";s:13:"__construct()";}wakeupobject(a)(1) { ["one"]=> string(13) "__construct()" }