note 127186 deleted from class.exception by cmb
| From: | cmb@php.net | Date: | Mon, 20 Jun 2022 12:43:09 +0000 |
| Subject: | note 127186 deleted from class.exception by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218603@lists.php.net to get a copy of this message | ||
Note Submitter: Walter Alexandre
----
On php 5.6, if you use a constant do define the code you get an error (exception):
class foo {
const EXCODE = 1;
try {
throw new Exception("Some message", EXCODE); // don't work.
}
}
But if you use a cast, it will work:
...
throw new Exception("Some message", (int) EXCODE); // it works.