Re: Re: Re: PHP 4.2

From: Date: Tue, 25 Jun 2002 23:20:31 +0000
Subject: Re: Re: Re: PHP 4.2
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-103851@lists.php.net to get a copy of this message
That looks pretty useful, I've been playing around with something like the following ... $test = strnatcasecmp (phpversion (), "4.2"); ... and going on to specify how to handle the vars according to the outcome of $test. I only have the one version of PHP to play with, and just wanted to ask if any versions throw out answers like "4.2.1 RC1" and whether that or anything else generated would affect the outcome of using strnatcasecmp (); If not, I quite like this method, obviously version_compare() would be better but as has been pointed out at present it operates within too narrow a band. Regards Zim > I use http://php.net/strnatcasecmp since version_compare is > only available > since 4.1.0, which is rather self-defeating :-) > > "Rasmus Lerdorf" <rasmus@php.net> wrote in message > news:Pine.LNX.4.44.0206242243430.2711-100000@www.lerdorf.com... >> You mean like php.net/version_compare ? >> >> On Mon, 24 Jun 2002, Dreamriver.com wrote: >> >>> >>> Hello All, >>> I also have the challenge of distributing php code to unknown php > versions. There is a wide discrepancy in the functionality of even various > PHP 4.x code. Since at the time of coding I don't know the version, I test > for it when I need to, and include code accordingly. >>> >>> >>> For example, in the case of image uploads I find out what PHP version > the server is running. I declare a 'yardstick' value. If the server version > is less than the yardstick then I include one block of code. If the server > version is equal to or greater than the 'yardstick' value then I include > another, different block of code. It's messy, and extra code, but it > works... >>> >>> >>> While there is a user contributed function for checking the difference > of two php versions: >>> >>> http://www.php.net/manual/en/function.phpversion.php >>> >>> interfear01 at hotmail dot com >>> 09-Jun-2002 03:00 >>> function check_php_version ($version) >>> >>> >>> ... wouldn't it be really nice to have the PHP development team make up > a formal, built in function to handle this growing need to check versions? >>> >>> >>> If such a function was made now, then we could rely on its availability > some years in the future... >>> >>> >>> Kind Regards, >>> >>> Richard Creech >>> info@dreamriver.com >>> Phone 250.744.3350 Pacific Time, Canada >>> Easily create your very own Yellow Pages - free download >>> http://www.dreamriver.com >>> >>> >>>> Message-ID: <20020624202700.66546.qmail@pb1.pair.com> >>>> To: php-general@lists.php.net >>>> From: "Peter" <newsaddress@saracenvsu.org.uk> >>>> Date: Mon, 24 Jun 2002 21:24:13 +0100 >>>> Subject: Re: PHP 4.2 >>>> >>>> If you want an all in one solution without having to have two versions, >>>> can't you read the status of register_globals from the config file and > base >>>> the rest of the script on this? >>>> eg >>>> if (register_globals == 'on') { >>>> $name = _POST['name']; >>>> $address = _GET['address']; >>>> } >>>> >>>> then you can access the variables as if register_globals = on even if > it >>>> isn't >>>> "Simon Troup" <simon.troup@digitalmusicart.com> wrote in message >>>> >>>> news:B93B7387.1D73%simon.troup@digitalmusicart.com... >>>>> I've written a small freeware script that gets installed on a variety > of >>>>> different platforms running various PHP versions. >>>>> >>>>> I've read through the manual about the super global arrays and how > post >>>> and >>>>> get vars are no longer registered by default, but am confused about > when >>>> it >>>>> would be a good idea to "upgrade" the script. >>>>> >>>>> If I change everything in the script and use $_GET and $_POST etc. > then >>>>> those people who are still using earlier versions won't be able to >>>> upgrade. >>>>> >>>>> Does anyone know what the uptake of the latest version is? What is >>>> everyone >>>>> else doing about this? If I were developing for one client it > wouldn't be >>>> a >>>>> problem as obviously you'd know what you were developing for. >>>>> >>>>> I'd just like some feedback on when would be a good time to upgrade > the >>>>> scripts while causing the minimum disruption and maintaining maximum > happy >>>>> users. >>>>> >>>>> Thanks >>>>> >>>>> Zim >>> >>> >>> >>> -- >>> PHP General Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >> > >

« previous php.general (#103851) next »