Orm: Consider PHP 7.2 for ORM.NEXT

Created on 27 Jun 2017  ·  11Comments  ·  Source: doctrine/orm

Primary motivation:

  • object typehint

    • should eliminate lots of mixed types across whole code base

    • greatly improving type safety & avoid potential mixed-related bugs

    • clean-up public API

    • less BC breaks in future versions

  • parameter type widening

    • could ease migration

    • mostly theoretical benefitl? (added return types will still break user-land things)

As an example, here's how EntityManagerInterface would look for 7.2. ☺️

PHP 7.2 is due to release before the end of year. There's already _alpha 2_ (without object typehint - should arrive in _alpha 3_ / _beta 1_).

Thoughts?

Improvement

Most helpful comment

That is ok. If they are not on bleeding edge php, they most likely won’t want to be on bleeding edge ORM either.

All 11 comments

I think this is more than feasible, and yes, it would allow us to add type hints to interfaces without breaking existing implementations. We just need to enforce the PHP constraint to be ^7.2 there.

Overall :+1:

FWIW, ODM ng (the upcoming 2.0 version) will most likely also require PHP 7.2, so we could let this change trickle down to the common libraries as well.

Initial Doctrine\Common 7.2 migration (for v. 3.x) here: https://github.com/doctrine/common/pull/805

PHP 7.2 is now BETA and Travis added support for it. 🎉

this would be problematic for those who just got PHP 7 support, not everyone is on bleeding edge, just a thought.

That is ok. If they are not on bleeding edge php, they most likely won’t want to be on bleeding edge ORM either.

Pretty much what @alcaeus said: if you are developing new software, the target stable version should be the current one. If you are maintaining existing software, you are perfectly ok with using stable dependencies that won't get new shiny features, yet will receive security updates.

True, though some people are stuck on web hosts that restrict their version. My webhost just got me on PHP 7, and they probably won't have 7.1 until next year. I'd love to work with 7.1, but my production environment prevents that unfortunately and I don't feel like babysitting my own server.

That's perfectly ok, but on the counter side, we aren't babysitting your
hosting provider either

On 15 Aug 2017 7:54 PM, "Ed Lomonaco" notifications@github.com wrote:

True, though some people are stuck on web hosts that restrict their
version. My webhost just got me on PHP 7, and they probably won't have 7.1
until next year. I'd love to work with 7.1, but my production environment
prevents that unfortunately and I don't feel like babysitting my own server.


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
https://github.com/doctrine/doctrine2/issues/6529#issuecomment-322540095,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJakMly0bmvET0FPQALz9QruzfNfwDsks5sYdtmgaJpZM4OGEyg
.

fair enough, I said my piece :)

Merged into develop in 9f5fd3713fa0c8f34a47519ea78d2a6337d65a22.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

doctrinebot picture doctrinebot  ·  4Comments

Inmmelman picture Inmmelman  ·  3Comments

doctrinebot picture doctrinebot  ·  4Comments

doctrinebot picture doctrinebot  ·  3Comments

alexander-schranz picture alexander-schranz  ·  3Comments