3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getUserEmail(): ?string { return 'foo@example.com'; } function sendEMail(string $email) { echo "Email address is $email"; } sendEmail( getUserEmail() ?: throw new Exception("Email required") );

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
164.4 ms | 1235 KiB | 10 Q