Re: Comments about http://wiki.php.net/qa/phptlessonslearned

From: Date: Wed, 03 Feb 2010 13:58:26 +0000
Subject: Re: Comments about http://wiki.php.net/qa/phptlessonslearned
References: 1  Groups: php.qa 
Request: Send a blank email to php-qa+get-65480@lists.php.net to get a copy of this message
Hi Jess
Hello all, I've read this document and found it very interesting. I was also introduced for the first time to generate-phpt.php, useful :) A few notes about the document: The page says: "This script was written by Zoe Slattery (thank you!) and can be found in the PHP 5_3 source code in scripts/dev/generate_phpt.php. Although it’s in the 5_3 source code, I think I’m right in saying that it can be used to create tests for all versions of PHP." 0. The script resides in scripts/dev/generate-phpt/src/generate-phpt.php, not scripts/dev/generate_phpt.php. It does indeed. I'll correct the wiki
1. It may work with 5_2 [haven't tried] but currently it tests the return value of phpversion() and die()s in case the minor < 3. As far as I recall it creates tests which you can use on any PHP version _but_ it requires 5.3 to execute. I think I used some features that are only available in 5.3 (reflection?) to generate the tests
2. Very minor and is about the script itself, not the document, but I think it would be best to use the PHP_MINOR_VERSION const [added in 5.2.7] or version_compare(). Fair point, I can't remember why I didn't use either of those. Probably because I did the first thing I thought of and it worked :-)
Zoe

« previous php.qa (#65480) next »