You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/12/12 05:11:09 UTC
[GitHub] [netbeans] the-liquid-metal opened a new issue, #5076: [PHP] Statement after never function call site should display warning message
the-liquid-metal opened a new issue, #5076:
URL: https://github.com/apache/netbeans/issues/5076
### Apache NetBeans version
Apache NetBeans 16
### What happened
```never``` type introduced in php 8.1 ([never](https://wiki.php.net/rfc/noreturn_type)).
Any statement after never function call will not executed, and should display warning message just to inform user.
### How to reproduce
```php
<?php
function redirect(string $uri): never {
header('Location: ' . $uri);
exit();
}
echo "before";
redirect("http://localhost/");
echo "after"; // this statement will not executed and SHOULD display warning message.
// --------------------------------------------------------
class Gateway {
public function __construct($connection, $params) {}
public function fetchDb(): object|null {}
public function thrower(): never {
throw new DbError(json_encode($this));
}
}
$gateway = new Gateway($connection, $params);
$data = $gateway->fetchDb() ?? $gateway->thrower();
echo "after"; // this statement might be executed and SHOULD NOT display warning message.
```
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
Windows 10
### JDK
Java: 14.0.1; Java HotSpot(TM) 64-Bit Server VM 14.0.1+7 Runtime: Java(TM) SE Runtime Environment 14.0.1+7
### Apache NetBeans packaging
Apache NetBeans provided installer
### Anything else
_No response_
### Are you willing to submit a pull request?
No
### Code of Conduct
Yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists