3v4l.org

run code in 300+ PHP versions simultaneously
<?php function connect($login, $password) { throw new exception ("Connect error!"); } echo "Credentials exposed\n"; try { try { connect("login", "password"); } catch (Throwable $e){ throw $e; } } catch (Throwable $e){ echo $e; // only for demonsration! do no use echo in the catch block } echo "\n\nCredentials hidden:\n"; try { try { connect("login", "password"); } catch (Throwable $e) { throw new exception($e->getMessage()); } } catch (Throwable $e) { echo $e; // only for demonsration! do no use echo in the catch block }

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
153.12 ms | 2295 KiB | 12 Q