Re: Initializing constants once, with code?
| From: | Mike Schinkel | Date: | Sun, 05 Jan 2020 19:19:24 +0000 |
| Subject: | Re: Initializing constants once, with code? | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-107996@lists.php.net to get a copy of this message | ||
Another use-case that just occurred to me is to support testing:
class Api {
const URL: string{
return $_ENV['EXAMPLE_API_URL'] ?? 'https://api.example.com';
}
}