Is it a good idea to have a "strict" mode?
| From: | César Rodas | Date: | Fri, 30 Jan 2015 05:16:20 +0000 |
| Subject: | Is it a good idea to have a "strict" mode? | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-81401@lists.php.net to get a copy of this message | ||
Hi!
I'm wondering if it would be a good idea to have a
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
strict mode in PHP.
Many language have them and it is a good idea.
I think it should be a bit different in PHP, it should encourage the
following things:
- Avoid deprecated things, it should throw an exception.
- Avoid explicit conversions of undefined constants to strings.
- Anything else that could make run-time slower *or* bad practice.
```php
"use strict";
var_dump(FOOBAR); // should throw an exception, undefined constant.
```
Good idea?
Cheers,
--
César D. Rodas
Open Source developer
+595-983-161124
PGP: F9ED A265 A3AB C8A1 D145 7368 158A 0336 C707 0AA6
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc