3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ function __construct(){ register_shutdown_function(array(__CLASS__, 'handle_shutdown')); echo "X\n"; while(1){ $t[]=new B(); } // echo "Y\n"; } static public function handle_shutdown(){ echo "B\n"; $b=new B(); $b=null; } } class B{ } $a=new A(); ?>
Output for 8.2.18, 8.3.5 - 8.3.6
X Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 4096 bytes) in /in/rtNlK on line 8 B
Process exited with code 255.
Output for 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
X Fatal error: Out of memory (allocated 31461376 bytes) (tried to allocate 4096 bytes) in /in/rtNlK on line 8 B mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 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, 8.1.28
X Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 33554440 bytes) in /in/rtNlK on line 8 B
Process exited with code 255.
Output for 8.1.2 - 8.1.27
X Fatal error: Out of memory (allocated 25169920) (tried to allocate 16777224 bytes) in /in/rtNlK on line 8 B mmap() failed: [12] Cannot allocate memory mmap() failed: [12] Cannot allocate memory
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 8.0.13
X Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 67108872 bytes) in /in/rtNlK on line 8 B
Process exited with code 255.
Output for 5.4.10 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
X Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/rtNlK on line 8 B
Process exited with code 255.
Output for 5.4.0 - 5.4.9
X Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 72 bytes) in /in/rtNlK on line 8 B
Process exited with code 255.
Output for 5.3.11 - 5.3.29
X Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 72 bytes) in /in/rtNlK on line 8 B
Process exited with code 139.
Output for 5.3.0 - 5.3.10
X Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 24 bytes) in /in/rtNlK on line 8 B
Process exited with code 255.
Output for 5.2.2 - 5.2.6, 5.2.10 - 5.2.17
X Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 71 bytes) in /in/F9kSV on line 8 B
Process exited with code 255.
Output for 5.2.7 - 5.2.9
X Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 64 bytes) in /in/F9kSV on line 8 B
Process exited with code 255.
Output for 5.2.1
X Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 72 bytes) in /in/F9kSV on line 8 B
Process exited with code 139.
Output for 5.2.0
X Fatal error: Out of memory (allocated 822345728) (tried to allocate 201326592 bytes) in /in/F9kSV on line 8 B
Process exited with code 139.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.1, 5.1.3 - 5.1.6
X
Process exited with code 137.
Output for 5.1.2
Strict Standards: Non-static method A::handle_shutdown() cannot be called statically, assuming $this from compatible context A in /in/F9kSV on line 4 X
Process exited with code 137.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/F9kSV on line 12
Process exited with code 255.
Output for 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/F9kSV on line 12
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/F9kSV on line 12
Process exited with code 255.
Output for 4.3.0
Parse error: parse error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/rtNlK on line 12
Process exited with code 255.

preferences:
260.53 ms | 401 KiB | 460 Q