How do you determine what PHP version a script requires?

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

Post Reply
User avatar
zeek
Forum Commoner
Posts: 48
Joined: Mon Feb 27, 2006 7:41 pm

How do you determine what PHP version a script requires?

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

(#10850)
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post 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!
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Oh wow that is cool.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

nickvd wrote::jawdrop:
Image

Just for you...
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

lol... Thanks!
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

You're Image
Post Reply