3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 7.0.0 - 7.1.0
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 hhvm-3.12.0
X mallctl opt.prof: No such file or directory (2) Fatal error: request has exceeded memory limit in /in/rtNlK on line 7 B
Process exited with code 255.
Output for hhvm-3.10.0
X Fatal error: request has exceeded memory limit in /in/rtNlK on line 7 B
Process exited with code 255.
Output for 5.4.20 - 5.6.28
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.10 - 5.4.19
X Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/F9kSV 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/F9kSV on line 8 B
Process exited with code 255.
Output for 5.3.28 - 5.3.29
X Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 64 bytes) in /in/rtNlK on line 8 B
Process exited with code 255.
Output for 5.2.7 - 5.2.9, 5.3.0 - 5.3.27
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.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.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.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.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.