Skip to content

Instantly share code, notes, and snippets.

@harikt
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harikt/d3d48b75dff4502d3ea1 to your computer and use it in GitHub Desktop.
Save harikt/d3d48b75dff4502d3ea1 to your computer and use it in GitHub Desktop.

Hey,

Nice write up. If the applications can work on 5.3, there will not be much problems to upgrade to the latest versions of PHP.

May be all library owners should consider upgrading the php versions of libraries and force people to update the apps to latest versions. Then there is a question of how to overcome the legacy applications. We should provide an alternative library which works with the latest version.

Eg : we have password_ functions for less than 5.5. Like that we should replace other functions which can make use of the 5.5 functionality .

Thoughts ?

@harikt
Copy link
Author

harikt commented Feb 10, 2015

Hey @iansltx ,

Just wanted to comment if we are not missing each other. I wasn't saying to make use of something like https://github.com/igorw/galapagos . Trait already supported ( igorw/galapagos#6 ) .

What I was trying to express was many of the users don't move to latest versions because some of the functions in 5.2 may be deprecated in 5.3 and later being removed. As an eg: http://php.net/manual/en/function.ereg-replace.php this is a simple function which can be build with http://php.net/manual/en/function.preg-replace.php

if (! function_exists('ereg_replace')) {
    function ereg_replace ( string $pattern , string $replacement , string $string ) {
       // implement
    }
}

There are many other functions probably cannot be addressed properly like this. So if there is a library which can provide the functionality probably the transmission can be much easier and they could eventually update the code.

@iansltx
Copy link

iansltx commented Feb 10, 2015

Fair point. So there's a bit of a need for "reverse polyfills" in some codebases.

Question is where the biggest use of deprecated/removed functions is. My bet is actually on mysql_*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment