3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
ok Fatal error: Out of memory (allocated 20971520 bytes) (tried to allocate 33554432 bytes) in /in/UvW9v on line 26 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.1.10 - 8.1.27
ok Fatal error: Out of memory (allocated 20971520) (tried to allocate 33554432 bytes) in /in/UvW9v on line 26 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 8.1.2 - 8.1.9
ok Fatal error: Out of memory (allocated 25165824) (tried to allocate 33554432 bytes) in /in/UvW9v on line 26 mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 7.2.0 - 7.2.4, 7.2.6 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.1
ok Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 67108864 bytes) in /in/UvW9v on line 26
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 8.0.13
ok Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 134217728 bytes) in /in/UvW9v on line 26
Process exited with code 255.
Output for 7.2.5
ok Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 67108864 bytes) in /in/UvW9v on line 26
Process exited with code 137.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25
ok
Output for 5.4.20 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 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.0.5, 5.1.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.3.11, 4.4.0 - 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.

preferences:
191.76 ms | 401 KiB | 326 Q