3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php ini_set("session.use_cookies", false); class A { public $b; public function __construct() { $this->b = new B(); } } class B { public $a; public function __construct() { $this->A = new A(); } } $a = new A(); session_start(); $id = session_id(); $_SESSION['test'] = $a; session_write_close(); session_id('boo'); session_start(); session_write_close(); session_id($id); session_start(); echo serialize($_SESSION['test']);
based on dnsGP
Output for 7.2.0
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 4096 bytes) in /in/K92rL on line 7
Process exited with code 255.
Output for 7.1.10

Process exited with code 137.
Output for 7.0.0 - 7.1.7
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 4096 bytes) in /in/K92rL on line 15
Process exited with code 255.
Output for 5.4.12 - 5.6.28
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 16777216 bytes) in /in/K92rL on line 7
Process exited with code 255.
Output for 5.3.22 - 5.3.29
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 523800 bytes) in /in/K92rL on line 7
Process exited with code 255.