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:11:"__construct";}'; echo $x; $u = unserialize($x); var_dump($u); ?>
based on p0c5F
Output for 5.1.3 - 5.6.28, 7.0.0 - 7.1.0
O:1:"A":1:{s:3:"one";s:11:"__construct";}wakeupobject(A)#1 (1) { ["one"]=> string(11) "__construct" } destruct__construct
Output for hhvm-3.10.0 - 3.12.0
O:1:"A":1:{s:3:"one";s:11:"__construct";}wakeupobject(A)#1 (1) { ["one"]=> string(11) "__construct" }
Output for 5.0.0 - 5.1.2
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/3Q7CU on line 2 O:1:"A":1:{s:3:"one";s:11:"__construct";}wakeupobject(A)#1 (1) { ["one"]=> string(11) "__construct" } destruct__construct
Output for 4.3.0 - 4.4.9
O:1:"A":1:{s:3:"one";s:11:"__construct";}wakeupobject(a)(1) { ["one"]=> string(11) "__construct" }