3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class c{} class n{} class b{} $c = new c; $c->left = new n; $c->right = new n; $c->left->child = new b; $c->right->child = new b; echo serialize($c) . "\n"; $c->right->child = $c->left->child; echo serialize($c) . "\n";
based on 6bt13
Output for 5.3.20 - 7.2.0
O:1:"c":2:{s:4:"left";O:1:"n":1:{s:5:"child";O:1:"b":0:{}}s:5:"right";O:1:"n":1:{s:5:"child";O:1:"b":0:{}}} O:1:"c":2:{s:4:"left";O:1:"n":1:{s:5:"child";O:1:"b":0:{}}s:5:"right";O:1:"n":1:{s:5:"child";r:3;}}