3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { $name ?? throw new Exception("variable is null or not defined"); } catch (Exception $e) { echo $e->getMessage() . "\n"; } try { $name = ''; $name ?: throw new Exception("variable is falsy"); } catch (Exception $e) { echo $e->getMessage() . "\n"; }

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
161.12 ms | 1457 KiB | 8 Q