문제

I have a website made for php 5.3 that uses a lot of features included in php 5.3.

My web server (wich is a share host) uses php 5.2 and the company doesn't support php 5.3.

So I want to know if there is a php framework, class, bunch of functions or anything I can use to "simulate" php 5.3 on a php 5.2 server?

If so, what is the best one and where can I find it?

도움이 되었습니까?

해결책

You could probably get 80% there, writing workarounds for some of what is introduced in PHP 5.3. However, there are a lot of things introduced at the language level that simply can't be emulated using PHP 5.2.

If you are really committed to your host, your best chance would be to evaluate exactly which features of PHP 5.3 your existing code is using, and then determine if those things fall within the scope of what you could find workarounds for. Alternatively, you could simply rewrite any code that is using PHP 5.3 features so that the would behave properly under 5.2. Either way, that's probably going to be a lot of work with not a significant amount of benefit (assuming changing hosts is an option).

So two options:

  1. If this is a situation where the code must run on this host (say it was a school project hosted on school servers, or similarly a company project on company servers), I think your best bet is going to be refactoring your code to run on PHP 5.2.

  2. If you can change hosts, I would recommend that as your best option.

다른 팁

I don't think you can. PHP 5.3 adds new options to the language that are not even close to being backwards compatible with PHP 5.2

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top