3v4l.org

run code in 300+ PHP versions simultaneously
<?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";
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Deprecated: Creation of dynamic property c::$left is deprecated in /in/1m5Cv on line 8 Deprecated: Creation of dynamic property c::$right is deprecated in /in/1m5Cv on line 9 Deprecated: Creation of dynamic property n::$child is deprecated in /in/1m5Cv on line 10 Deprecated: Creation of dynamic property n::$child is deprecated in /in/1m5Cv on line 11 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;}}
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28
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;}}

preferences:
226.53 ms | 404 KiB | 327 Q