Is Doctrine2 compatible with PHP 5.3 up?
-
04-10-2019 - |
Question
It seems doctrine 2 is compatible only with PHP 5.3 and up, and is NOT compatible with php versions before 5.3. Can someone confirm if this is true?
Solution
Doctrine 2 heavily uses PHP namespaces. So, yes, you won't have luck with it under PHP < 5.3.
By the way: they use the namespaces for both internal code and qualified names for your models. You might find portions of Doctrine that you can re-use under 5.2, but I wouldn't be too optimistic about that.
OTHER TIPS
If the docs say 5.3 then it is 5.3 for a reason, presumably because some code uses some functionality that is only available in 5.3.
You might find that the parts of Doctrine2 you need can run under 5.2, or you can write functions for 5.2 to mimic those that are in 5.3.
But bear in mind that if you ever want to use allow its features your going to have to upgrade to 5.3 or move hosts.
Use it under something other than 5.3 and see what happens.