• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Why does php keep deprecating stuff, is there a way to restore backwards compatibilit

Red Squirrel

No Lifer
It seems every time I migrate my sites to a new server half my stuff breaks because it seams each new version of php decides to deprecate functions or change the way stuff works. Really frustrating, I can't be sending my time rewriting stuff all the time. It seems to always be non custom code that is affected, most of the stuff I've written myself will usually work fine.

Rather than have to rewrite the scripts that are affected or update + rewrite customizations is there a way to just restore the old functionality while keeping the new php version?
 
Stuff that they actually removed. So the code actually breaks.

Going through line by line and fixing it but it's just annoying how they seem to be doing that a lot lately. So far most of the changes have been simple enough, like they got rid of the function eregi (never even heard of it but some scripts were using it) but turns out it's basically the same as preg_match. Stuff of that nature.
 
why are you even upgrading your php version? do you need the new features or something? if that is the case, then yeah, just something you will have to maintain.

if it ain't broke, don't try to fix it.
 
Hard to do that if you want to stay on an decently updated OS. Sometimes there are exploits and stuff that come out so you want to keep the actual programs updated. It gets updated by default when you move to a new OS and do a yum update.

The old server was on CentOS 4. I recently migrated to a new server, I'm not going to install CentOS 4 when I can install CentOS 6.x. (actually tried 7 but was not too fond of it, it's still too new and buggy).

Unless there's somehow a way to downgrade just php and make sure it does not get upgraded when I do yum update?

I guess the proper way is to just fix all the scripts but it's just annoying how they keep doing this. Was hoping there was some kind of mode I could toggle in php.ini or something so it makes all that deprecated stuff still work.
 
If it is deprecated, the functionality should still remain in tact until a later version removes it. Perhaps, before upgrading, you should read what has been removed or what functionality has been reworked?

The reason they remove that is because they've come up with a much better way to do it. Deprecating something for a few versions helps let you know it is eventually going to be completely removed and it is best to use the new functionality.

At least, that is what I think the idea behind it is. If the version you're using is working fine and without major security flaws, there is little reason to upgrade unless you require the new functionality. Plenty of code is still out there running on Java 6, with few intentions to upgrade to 7, let alone 8.
 
Hard to do that if you want to stay on an decently updated OS. Sometimes there are exploits and stuff that come out so you want to keep the actual programs updated. It gets updated by default when you move to a new OS and do a yum update.

The old server was on CentOS 4. I recently migrated to a new server, I'm not going to install CentOS 4 when I can install CentOS 6.x. (actually tried 7 but was not too fond of it, it's still too new and buggy).

Unless there's somehow a way to downgrade just php and make sure it does not get upgraded when I do yum update?

I guess the proper way is to just fix all the scripts but it's just annoying how they keep doing this. Was hoping there was some kind of mode I could toggle in php.ini or something so it makes all that deprecated stuff still work.

i just don't see why you would be upgrading to a newer OS if everything is already working fine for you. just seems like upgrading for the sake of upgrading.

i do get the security vulnerabilities though, but i'd think there would just be patches for the OS that would solve those, not forcing you to upgrade to a whole new version of the OS.

also, i'd think there would HAVE to be a way to use a specific version of php.

if i recall correctly, when we used to use yum to install compass for sass compilation, by default it would install the latest version and we had to pass in a param (which i think was just the version number) to get an earlier version of compass due to compatibility issues with our version of sass.
 
If you are running an OS that is so new that it doesn't have your major version of PHP installed then you can still install it from source.

Also, just because you are running version X.Y.Z that was released 3 years ago doesn't mean that your distributions package maintainers aren't backporting security fixes to the stable version they have in the repository.

The biggest point being you can't just blindly upgrade software and expect your custom software to still work properly. There's a reason most modern programming languages and frameworks have a dependency/linking system.
 
Upgrading versions can be a huge pain. There is a reason why companies are often many versions behind.

My company just spent several man months making our Java 6 code compatible with Java 7. We even sometimes have to make a few changes when we upgrade our Tomcat version.
 
Hard to do that if you want to stay on an decently updated OS. Sometimes there are exploits and stuff that come out so you want to keep the actual programs updated. It gets updated by default when you move to a new OS and do a yum update.

In that case, you don't want to use deprecated functionality.
 
In that case, you don't want to use deprecated functionality.

Duh, but that's often out of your control if you did not write the scripts. All of the scripts I wrote myself are never affected by this stuff it's always the premade stuff. For example I wont wrote my own forum script, I'll use a premade one. Now suddenly just because I migrate to a new server I need to update and rewrite everything. Typically something big like a forum is an involved project as there will be lot of custom stuff too such as anti spam measures that need to be coded back in to the new one. Not to mention the template alone.

You would think php would just throw a warning instead of outright removing stuff. Then again, you'd think that the ones who code scripts that distribute them would ensure that they use proper practices that arn't about to get deprecated. Usually in coding tutorials it will say "you can do it this way but that's not recommended". So best not to do it that way. The fault is on both sides I guess.
 
Back
Top