
August 31st, 2003
06:37 AM
Which PHP version
I am making a news script and I was wondering if anyone knew of a program that will go through a php file and look at all the functions used and check what PHP version is necessary.
IE:
not_real.php contains:
<?php
getimagesize("http://made.up/file/img.jpg");
array_rand($some_array, 2);
?>
getimagesize() would make the program set the required php version at 3, but array_rand() would change it to php version 4.
and just so you know i searched google and this forum but couldn't find anything to help me
Thanks in advance!!
___________________
ProBB - The Best Thing to Happen to BBs Since YaBB

August 31st, 2003
07:22 AM
$V = preg_replace('/[a-zA-Z\.]/','',phpversion());
deal with $V how you want.
___________________
Current Project: LivermoreMuscle.com
Sig Hosted by Motorspin

August 31st, 2003
07:25 AM
if ( !function_exists ( 'array_rand' ) )
{
function array_rand ( )...
___________________
http://celerondude.com

August 31st, 2003
08:25 AM
Originally posted by CDude
if ( !function_exists ( 'array_rand' ) )
{
function array_rand ( )...
That was just a random function i through in to expllain
i forgot to clarify something. I want this so i can tell anybody who downloads my system what the earliest version of php (where every function is in) they will need
___________________
ProBB - The Best Thing to Happen to BBs Since YaBB

August 31st, 2003
08:31 AM
that's easy, pick the newest function you use and that will be the requirement.
___________________
http://celerondude.com

August 31st, 2003
08:34 AM
Originally posted by CDude
that's easy, pick the newest function you use and that will be the requirement.
The point of the program I am asking about is to do just that
I dont really feel like going through 40 files and make a list of every single function and then check php.net for each function
___________________
ProBB - The Best Thing to Happen to BBs Since YaBB

August 31st, 2003
09:38 AM
You can already guess based on your experience with PHP. It's better to set a base version and work from there. Spend more time on the script and less time with useless problems.
___________________
http://celerondude.com