3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Person { public $dad; public function __destruct() { $this->dad = null; /* no segfault if this is commented out */ } } class Dad extends Person { public $son; public function __construct() { $this->son = new Person; $this->son->dad = $this; /* no segfault if this is commented out */ } public function __destruct() { $dad = new dad; parent::__destruct(); /* segfault here */ } } $o = new Dad; unset($o); echo "ok\n";
Output for 7.0.0 - 7.1.0
ok
Output for 5.4.20 - 5.6.28
ok Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 33554432 bytes) in /in/UvW9v on line 26
Process exited with code 255.
Output for 5.4.10 - 5.4.19
ok Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/UvW9v on line 39
Process exited with code 139.
Output for 5.4.0 - 5.4.9
ok Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 8 bytes) in /in/UvW9v on line 26
Process exited with code 139.
Output for 5.3.0 - 5.3.29
ok Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 72 bytes) in /in/UvW9v on line 26
Process exited with code 139.
Output for 5.2.10 - 5.2.17
ok Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 24 bytes) in /in/UvW9v on line 11
Process exited with code 255.
Output for 5.2.9
ok Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 75 bytes) in /in/UvW9v on line 26
Process exited with code 255.
Output for 5.0.0 - 5.1.6, 5.2.6 - 5.2.8
ok
Process exited with code 139.
Output for 5.2.2 - 5.2.5
ok Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 72 bytes) in /in/UvW9v on line 26
Process exited with code 255.
Output for 5.2.1
ok Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 64 bytes) in /in/UvW9v on line 26
Process exited with code 255.
Output for 5.2.0
ok
Process exited with code 137.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/UvW9v on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/UvW9v on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/UvW9v on line 7
Process exited with code 255.