I am migrating to the latest 7.3 and would like to get in all the code before actually migrating. I need to use the function is_countable which is new to 7.3 so it will throw an error on my existing site running on 7.2. So, I created a function in the mean time is_countable_temp($temp) which just returns TRUE.
What I would like to do is check the version and if it is greater then or equal to 7.3 then use the actual is_counbable function else just return true.
enter code here
function is_countable_temp($temp) {
// if version is 7.3 or greater then call the is_countable function else just return true.
}
2
Answers
You can get the php version like described here and compare it with version compare:
But you could also achieve the desired functionality with
function_exists('is_countable')
, so:And you are aware that we are at version 8 already, right?