Page 1 of 1

How do you determine what PHP version a script requires?

Posted: Fri Oct 13, 2006 2:52 pm
by zeek
I need to determine the minimum PHP version required for this script. Actually it's an application consisting of multiple scripts. I don't have access to multiple versions of PHP installs, and I don't have time to go through the entire application checking functions and operators, etc., so I'm hoping there's another way to test, like some php.ini version setting or maybe some tool or something.

How do you determine minimum PHP version required for a script? Thanks in advance.

Posted: Fri Oct 13, 2006 3:19 pm
by feyd
I don't really see how you couldn't have access to multiple versions of php installs, but the general way is pulling the function list from php.net with their version incepts and cross check it. You can automate a lot of this after accumulating the incept information using php's internal tokenizer.

Posted: Fri Oct 13, 2006 3:30 pm
by Christopher

Posted: Fri Oct 13, 2006 5:25 pm
by nickvd
arborint wrote:PEAR PHP_CompatInfo
:jawdrop:

Assuming that smiley doesn't exist... My jaw just hit the floor... I wish i knew about that package before...

Using D11's db class, it spit out:

Code: Select all

Array
(
    [version] => 5.0.0
    [extensions] => Array
        (
            [0] => mysql
        )

    [constants] => Array
        (
            [0] => private
            [1] => interface
            [2] => public
            [3] => __CLASS__
        )

)
SPANKIN!

Posted: Fri Oct 13, 2006 5:30 pm
by Ollie Saunders
Oh wow that is cool.

Posted: Fri Oct 13, 2006 5:34 pm
by RobertGonzalez
nickvd wrote::jawdrop:
Image

Just for you...

Posted: Fri Oct 13, 2006 5:41 pm
by nickvd
lol... Thanks!

Posted: Fri Oct 13, 2006 5:48 pm
by RobertGonzalez
You're Image