3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php ini_set('display_errors', false); error_reporting(-1); set_error_handler(function($code, $string, $file, $line){ throw new ErrorException($string, null, $code, $file, $line); }); register_shutdown_function(function(){ $error = error_get_last(); if(null !== $error) { echo 'Caught at shutdown'; } }); try { while(true) { $data .= str_repeat('#', PHP_INT_MAX); } } catch(\Exception $exception) { echo 'Caught in try/catch'; }
Output for 5.6.0 - 5.6.8, 7.0.0 - 7.2.12
Caught at shutdown
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: String length exceeded: 9223372036854775807 > 2147483623 in /in/n7OSa:-1 Stack trace: #0 /in/n7OSa(-1): str_repeat() #1 {main} Caught at shutdown
Process exited with code 255.
Output for hhvm-3.20.2 - 3.21.3
Fatal error: Uncaught Error: String length exceeded: 9223372036854775807 > 2147483623 in /in/n7OSa:23 Stack trace: #0 /in/n7OSa(23): str_repeat() #1 {main} Caught at shutdown
Process exited with code 255.
Output for hhvm-3.19.2
Fatal error: Uncaught Error: String length exceeded 2^31-2: 9223372036854775807 in /in/n7OSa:23 Stack trace: #0 /in/n7OSa(23): str_repeat() #1 {main} Caught at shutdown
Process exited with code 255.
Output for hhvm-3.15.4 - 3.18.5
Fatal error: Uncaught Error: String length exceeded 2^31-2: 9223372036854775807 in /in/n7OSa:23 Stack trace: #0 {main} Caught at shutdown
Process exited with code 255.
Output for 5.6.9 - 5.6.38
Caught in try/catch