# [PHP DEV] Bugs, BC, Strict Mode??

- Thread: https://externals.io/message/96464
- Original archive: https://news-web.php.net/php.internals/96464
- Started by Michael Morris on 2016-10-19T05:54:02+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #96464 — Michael Morris — 2016-10-19T05:54:02+00:00

URL: https://externals.io/message/96464#96464

I've seen a couple bug fixes come up that create BC breaks for the code
reliant on the broken behavior.

JavaScript has a opt in strict mode for this. Perhaps PHP could do the
same. An opt in mode with the declare directive that turns on bug fixes
that are BC problems.

One recent example, the behavior of parse_url.

The ternary operator being backwards (right to left instead of left to
right as in all other languages) is another.

This approach lets some PHP 8 code be developed early by making troublesome
bug fixes available early.

The drawback is code bloat - both implementations would be in the code at
the same time. Also, core functions would need to check if the calling code
wants the normal or strict version of the function.

Or maybe namespaces and the use (use Strict; ) could handle this.
