aidantwoods / aidantwoods/SecureHeaders

Drop PHP 5.x

Offen
#62 8 Kommentare 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
PHP
Sterne
433
Forks
21
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

SecureHeaders was originally written in PHP 7.

However, I wanted as many people as possible to be able to use these browser security features easily, and didn't want it to be unusable by someone just because they were stuck with a lazy hosting provider.

So I backported the codebase all the way back to PHP 5.3 (and I took scalar type exceptions back with me! 😉)
PHP 5.6 initial backport: https://github.com/aidantwoods/SecureHeaders/commit/45658335548b16f09d259335de96c194d44057df
PHP 5.4: https://github.com/aidantwoods/SecureHeaders/commit/21920586bdab0ca51a04701574560d477e69fe8b
PHP 5.3: https://github.com/aidantwoods/SecureHeaders/commit/cdab04a075d29cad1693c92d0d32f75c208c4973

A year(-ish) later and two major versions out, the minimum version has increased to PHP 5.4. I think that's where I'm comfortable drawing the line though. It certainly doesn't make sense to continue supporting versions of PHP that the PHP team themselves don't.
As far as official support goes, PHP 5.6 is the only version on 5.x not to be end of life, and it will no longer receive updates unless they are security related. It'll be that way for a while longer, so it might make sense to still support that. We'd even gain the `...` operator for type-hinting collections of objects.
However, we're still missing proper language enforced type safety for scalars, return type hints, and strict mode to disable "type coercion". For these features, I feel it will be worth dropping 5.6 too.

If you really have to use PHP 5.x, `2.x` isn't going anywhere. `2.x` will likely enjoy quite a few more updates too. This just forewarning that when `3.0` finally rolls around, it'll be modern PHP only.

---

Edit: Starting a checklist of sub-tasks/issues in this meta-issue, that'll need to be completed when the transition is underway (don't worry, still not yet).

- [ ] Type Safety
- Scalar type hints
- Return type hints
- `strict_types=1`
- Type hint collections when possible with `...` operator
- [ ] [Move away from OpenSSL for randomness](https://secure.php.net/manual/en/function.random-bytes.php) (could perhaps do this sooner in `2.x` too)

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.