3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $foo = new \StdClass; $bar = new \StdClass; $foo->bar = $bar; $bar->foo = $foo; $vars = array('foo' => $foo, 'bar' => $bar); var_dump(serialize($vars));
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(92) "a:2:{s:3:"foo";O:8:"stdClass":1:{s:3:"bar";O:8:"stdClass":1:{s:3:"foo";r:2;}}s:3:"bar";r:3;}"
Output for 5.0.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Rp4VQ on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Rp4VQ on line 3 string(92) "a:2:{s:3:"foo";O:8:"stdClass":1:{s:3:"bar";O:8:"stdClass":1:{s:3:"foo";r:2;}}s:3:"bar";r:3;}"
Output for 4.3.10 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Rp4VQ on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Rp4VQ on line 3 string(107) "a:2:{s:3:"foo";O:8:"stdClass":1:{s:3:"bar";O:8:"stdClass":0:{}}s:3:"bar";O:8:"stdClass":1:{s:3:"foo";r:2;}}"
Output for 4.3.0 - 4.3.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Rp4VQ on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Rp4VQ on line 3 string(151) "a:2:{s:3:"foo";O:8:"stdClass":1:{s:3:"bar";O:8:"stdClass":0:{}}s:3:"bar";O:8:"stdClass":1:{s:3:"foo";O:8:"stdClass":1:{s:3:"bar";O:8:"stdClass":0:{}}}}"