Jump to content

Get PHP Version


onlyican

Recommended Posts

Hey

Stupid question, I have forgotton

I am building a big website
And to save updating when my server changes host
I want to build in the changes between PHP V4 and V5

For example
I am building a class
I want to have in the globals page
[code]
<?php
define("PHP_VERSION", $php_version, 1);

//then for the class

if(PHP_VERSION == 4){
//Same as the Function Name
//Not really called MyClass, this is an example
function MyClass(){

}
}else{
function __construct(){

}
}
?>
[/code]

I know I can use the same function name as the construct in PHP V 5
But there are other things I want to know the version for.

Can anyone help me
Link to comment
https://forums.phpfreaks.com/topic/30041-get-php-version/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.