Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20177 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88278 invoked by uid 1010); 19 Nov 2005 14:21:03 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 88263 invoked from network); 19 Nov 2005 14:21:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Nov 2005 14:21:03 -0000 X-Host-Fingerprint: 192.38.9.232 gw2.emini.dk Linux 2.4/2.6 Received: from ([192.38.9.232:7344] helo=gw2.emini.dk) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 62/89-11378-DC43F734 for ; Sat, 19 Nov 2005 09:21:02 -0500 Received: from foxbox (1Cust194.tnt30.lnd3.gbr.da.uu.net [62.188.122.194]) by gw2.emini.dk (Postfix) with ESMTP id 9DC138F89E for ; Sat, 19 Nov 2005 15:20:52 +0100 (CET) Message-ID: <017401c5ed14$6dc59000$e0acbc3e@foxbox> Reply-To: "Steph Fox" To: "internals" Date: Sat, 19 Nov 2005 14:20:42 -0000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0171_01C5ED14.6C416100" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 Subject: Upgrade notes for PHP 5.1 - final draft From: steph@zend.com ("Steph Fox") ------=_NextPart_000_0171_01C5ED14.6C416100 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Guys and guyess, Hopefully this is the final version of the upgrade notes. Please could you scroll through it (particularly if you've been involved in developing any of the affected areas) and get back to me ASAP if you find any misconceptions, missing information about changes that will affect legacy code, or downright errors. These notes need to be 100% complete and agreed by 18:00 hours UTC Sunday - no inet access for me after this until post-release. Thanks all, especially Jani for the helpful multi-file script. - Steph ------=_NextPart_000_0171_01C5ED14.6C416100 Content-Type: text/plain; name="final_upgrade_notes.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="final_upgrade_notes.txt" UPGRADE NOTES - PHP 5.1=0A= =0A= 1. Changes in reference handling=0A= a. Overview=0A= b. Code that worked under PHP 4.3, but now fails=0A= c. Code that was valid under PHP 4.3, but now throws an error=0A= d. Code that failed under PHP 4.3, but now works=0A= e. Code that 'should have worked' under PHP 5.0=0A= f. Warnings that came and went=0A= 2. String offset access=0A= 3. Reading []=0A= 4. instanceof, is_a(), is_subclass_of(), catch=0A= 5. Integer values in function parameters=0A= 6. Abstract private methods=0A= 7. Access modifiers in interfaces=0A= 8. Extensions=0A= a. Extensions that are gone from the PHP core=0A= b. Class constants in new PHP 5.1 extensions=0A= 9. Date/time support=0A= 10. Changes in database support=0A= a. PDO overview=0A= b. Changes in MySQL support=0A= c. Changes in SQLite support=0A= 11. Further migration information=0A= 12. Checking for E_STRICT errors=0A= =0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=0A= =0A= 1. Changes in reference handling=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=0A= =0A= 1a. Overview=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= =0A= From the PHP script writer's point of view, the change most likely to = impact=0A= legacy code is in the way that references are handled in all PHP versions=0A= post-dating the PHP 4.4.0 release.=0A= =0A= Until and including PHP 4.3, it was possible to send, assign or return = variables=0A= by reference that should really be returned by value, such as a = constant, a=0A= temporary value (e.g. the result of an expression), or the result of a = function=0A= that had itself been returned by value, as here:=0A= =0A= =0A= =0A= Although this code would usually work as expected under PHP 4.3, in the = general=0A= case the result is undefined. The Zend Engine could not act correctly on = these=0A= values as references. This bug could and did lead to various = hard-to-reproduce=0A= memory corruption problems, particularly where the code base was large.=0A= =0A= In PHP 4.4.0, PHP 5.0.4 and all subsequent PHP releases, the Engine was = fixed=0A= to 'know' when the reference operation is being used on a value that = should=0A= not be referenced. The actual value is now used in such cases, and a = warning=0A= is emitted. The warning takes the form of an E_NOTICE in PHP 4.4.0 and = up,=0A= and E_STRICT in PHP 5.0.4 and up.=0A= =0A= Code that could potentially produce memory corruption can no longer do = so.=0A= However, some legacy code might work differently as a result.=0A= =0A= 1b. Code that worked under PHP 4.3, but now fails=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= =0A= =0A= Running the above script under any version of PHP that pre-dates the = reference=0A= fix would produce this output:=0A= =0A= array(3) {=0A= [0]=3D>=0A= &string(1) "a"=0A= [1]=3D>=0A= &string(1) "b"=0A= [2]=3D>=0A= &string(1) "c"=0A= }=0A= =0A= Following the reference fix, the same code would result in:=0A= =0A= array(3) {=0A= [0]=3D>=0A= &string(1) "c"=0A= [1]=3D>=0A= &string(1) "c"=0A= [2]=3D>=0A= &string(1) "c"=0A= }=0A= =0A= This is because, following the changes, func() assigns by value. The = value=0A= of $y is re-assigned, and reference-binding is preserved from $z. Prior=0A= to the fix, the value was assigned by reference, leading $y to be=0A= re-bound on each assignment. The attempt to bind to a temporary value=0A= by reference was the cause of the memory corruption.=0A= =0A= Such code can be made to work identically in both the pre-fix and the=0A= post-fix PHP versions. The signature of func() can be altered to return=0A= by reference, or the reference assignment can be removed from the result=0A= of func().=0A= =0A= =0A= =0A= In PHP 4.3 $x would be 'original value', whereas after the changes it = would=0A= be 'function return' - remember that where the function does not return = by=0A= reference, the reference assignment is converted to a regular assignment.=0A= Again, this can be brought to a common base, either by forcing func() to=0A= return by reference or by eliminating the by-reference assignment.=0A= =0A= 1c. Code that was valid under PHP 4.3, but now throws an error=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= =0A= getThis();=0A= }=0A= }=0A= =0A= $bar =3D new Foo();=0A= $bar->destroyThis();=0A= var_dump($bar);=0A= =0A= ?>=0A= =0A= In PHP 5.0.3, $bar evaluated to NULL instead of returning an object.=0A= That happened because getThis() returns by value, but the value here=0A= is assigned by reference. Although it now works in the expected way,=0A= this is actually invalid code which will throw an E_NOTICE under=0A= PHP 4.4 or an E_STRICT under PHP 5.0.4 and up.=0A= =0A= 1d. Code that failed under PHP 4.3, but now works=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= =0A= =0A= =0A= In PHP 4.3 the third call to var_dump produces NULL, due to the memory=0A= corruption caused by returning an uninitialized value by reference.=0A= This is valid code in PHP 5.0.4 and up, but threw errors in earlier=0A= releases of PHP.=0A= =0A= array('alfa' =3D> 'ok'));=0A= $arr =3D& $arr['a1'];=0A= echo '-'.$arr['alfa']."-\n";=0A= =0A= ?>=0A= =0A= Until PHP 5.0.5, it wasn't possible to assign an array element by=0A= reference in this way. It now is.=0A= =0A= 1e. Code that 'should have worked' under PHP 5.0=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= =0A= There are a couple of instances of bugs reported under PHP 5.0 prior=0A= to the reference fixes which now 'work'. However, in both cases errors=0A= are thrown by PHP 5.1, because the code was invalid in the first place.=0A= Returning values by reference using self:: now works in the general=0A= case but throws an E_STRICT warning, and although your mileage may=0A= vary when assigning by reference to an overloaded object, you will=0A= still see an E_ERROR when you try it, even where the assignment=0A= itself appears to work.=0A= =0A= 1f. Warnings that came and went=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=0A= =0A= =0A= =0A= Nested calls to functions returning by reference are valid code under = both=0A= PHP 4.3 and PHP 5.1, but threw an unwarranted E_NOTICE or E_STRICT under=0A= the intervening PHP releases.=0A= =0A= 2. String offset access=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= =0A= In PHP, both [] and {} can be used for accessing string offsets, e.g.=0A= =0A= php -r "$str =3D "string"; echo $str{5}";=0A= and=0A= php -r "$str =3D "string"; echo $str[5]";=0A= =0A= would both return the same result. This has led to many complaints over=0A= inconsistent code in the past, and the [] syntax was deprecated some = years=0A= ago in an attempt to resolve the issue. However, it appears that [] is = the=0A= more popular means of accessing string offsets, so the decision has now=0A= been made to deprecate the {} string offset syntax instead, with the=0A= intention of removing it fully at a later date.=0A= =0A= php -r "$str =3D "string"; echo $str{5}";=0A= will now return an E_STRICT message to that effect in PHP 5.1.0 and up,=0A= and you are strongly discouraged from using this syntax in new code.=0A= =0A= 3. Reading []=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= =0A= test_ref($ar[]);=0A= var_dump($ar);=0A= $this->test($ar[]);=0A= }=0A= }=0A= =0A= $o =3D new XmlTest();=0A= $o->run();=0A= =0A= ?>=0A= =0A= This should always have thrown a fatal E_ERROR, because [] cannot be used=0A= for reading in PHP. It is invalid code in PHP 4.4.2 and PHP 5.0.5 upward.=0A= =0A= 4. instanceof, is_a(), is_subclass_of(), catch=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= =0A= In PHP 5.0, is_a() was deprecated and replaced by the "instanceof" = operator.=0A= There were some issues with the initial implementation of "instanceof", = which=0A= relied on __autoload() to search for missing classes. If the class was = not=0A= present, "instanceof" would throw a fatal E_ERROR due to the failure of=0A= __autoload() to discover that class. The same behaviour occurred in the=0A= "catch" operator and the is_subclass_of() function, for the same reason.=0A= =0A= None of these functions or operators call __autoload() in PHP 5.1, and=0A= the class_exists() workarounds used in code written for PHP 5.0, while=0A= not problematic in any way, are no longer necessary.=0A= =0A= 5. Integer values in function parameters=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= =0A= With the advent of PHP 5.0, a new parameter parsing API was introduced=0A= which is used by a large number of PHP functions. In all versions of=0A= PHP between 5.0 and 5.1, the handling of integer values was very strict=0A= and would reject non-well formed numeric values when a PHP function=0A= expected an integer. These checks have now been relaxed to support=0A= non-well formed numeric strings such as " 123" and "123 ", and will=0A= no longer fail as they did under PHP 5.0. However, to promote code=0A= safety and input validation, PHP functions will now emit an E_NOTICE=0A= when such strings are passed as integers.=0A= =0A= 6. Abstract private methods=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=0A= =0A= Abstract private methods were supported between PHP 5.0.0 and PHP 5.0.4,=0A= but were then disallowed on the grounds that the behaviours of 'private'=0A= and 'abstract' are mutually exclusive.=0A= =0A= 7. Access modifiers in interfaces=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=0A= =0A= Under PHP 5.0, function declarations in interfaces were treated in = exactly=0A= the same way as function declarations in classes. This has not been the = case=0A= since [Oct 13th 2004], at which point only the 'public' access modifier = was=0A= allowed in interface function declarations. Since [April 26th 2005], the=0A= 'static' modifier has also been allowed. However, the 'protected' and = 'private'=0A= modifiers will now throw an E_ERROR, as will 'abstract'. Note that this = change=0A= should not affect your existing code, as none of these modifiers makes = sense=0A= in the context of interfaces anyway.=0A= =0A= 8. Extensions=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= =0A= 8a. Extensions that are gone from the PHP core=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= =0A= One of the first things you're likely to notice when you download PHP = 5.1 is that=0A= several of the older extensions have disappeared. Those extensions that = are still=0A= actively maintained are available in the PHP Extension Community Library = (PECL),=0A= at http://pecl.php.net. Windows binaries are built regularly, and you = can obtain=0A= the binaries for PECL extensions built against PHP 5.1 from=0A= http://pecl4win.php.net/list.php/5_1.=0A= =0A= Extension Alternative/status=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= ext/cpdf pecl/pdflib=0A= ext/dbx pecl/dbx=0A= ext/dio pecl/dio=0A= ext/fam not actively maintained=0A= ext/ingres_ii pecl/ingres=0A= ext/ircg not actively maintained=0A= ext/mcve pecl/mcve=0A= ext/mnogosearch not actively maintained=0A= ext/oracle ext/oci8 or ext/pdo_oci=0A= ext/ovrimos not actively maintained=0A= ext/pfpro not actively maintained=0A= - alternatives at = http://pecl.php.net/packages.php?catpid=3D18&catname=3DPayment=0A= ext/w32api pecl/ffi=0A= ext/yp not actively maintained=0A= sapi/activescript pecl/phpscript=0A= =0A= Modules in PECL that are not actively maintained (i.e. have not been = supported=0A= for some time, have no active maintainer working on them currently, and = do not=0A= have any PECL package releases), are still available in CVS at=0A= http://cvs.php.net/pecl/. However, unreleased PHP modules are by their = nature=0A= unsupported, and your mileage may vary when attempting to install or use = them.=0A= =0A= 8b. Class constants in new PHP 5.1 extensions=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= =0A= The Zend Engine 2.1 API allows extension developers to declare class = constants=0A= in object oriented extensions. New extensions written for PHP 5.1, = including SPL,=0A= PDO, ext/XMLReader and ext/date, have their constants in the format=0A= =0A= PDO::CLASS_CONSTANT=0A= =0A= rather than in the C format=0A= =0A= PDO_CLASS_CONSTANT=0A= =0A= in order to minimise pollution of the global namespace in PHP.=0A= =0A= Note that the new Date class exists at this point purely to allow the = core date=0A= extension to adhere to the above convention, although extended = functionality=0A= is planned for the the class in the future.=0A= =0A= 9. Date/time support=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= =0A= Date/time support has been fully rewritten in PHP 5.1, and no longer=0A= uses the system settings to 'know' the timezone in operation. It will=0A= instead utilize, in the following order:=0A= =0A= * The timezone set using the date_default_timezone_set() function (if = any)=0A= * The TZ environment variable (if non empty)=0A= * The date.timezone ini option (if set)=0A= * "magical" guess (if the operating system supports it)=0A= * If none of the above options succeeds, UTC=0A= =0A= To ensure accuracy (and avoid an E_STRICT warning), you will need to = define=0A= your timezone in your php.ini using the following format:=0A= =0A= date.timezone =3D Europe/London=0A= =0A= The supported timezones are listed, in this format, in the PHP manual at=0A= http://www.php.net/manual/en/timezones.php.=0A= =0A= 10. Changes in database support=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=0A= =0A= 10a. PDO overview=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= =0A= PHP Data Objects (PDO) were introduced as a PECL extension under PHP 5.0,=0A= and became part of the core PHP distribution in PHP 5.1. The PDO = extension=0A= provides a consistent interface for database access, and is used = alongside=0A= database-specific PDO drivers. Each driver may also have = database-specific=0A= functions of its own, but basic data access functionality such as issuing=0A= queries and fetching data is covered by PDO functions, using the driver=0A= named in PDO::__construct().=0A= =0A= You are encouraged to use PDO when creating new projects in PHP 5.1. = Legacy=0A= code will generally rely on the pre-existing database extensions, which = are=0A= still maintained.=0A= =0A= Note that the PDO extension, and its drivers, are intended to be built as=0A= shared extensions. This will enable straightforward driver upgrades from=0A= PECL, without the need to rebuild PHP 5.1.=0A= =0A= There is more in-depth information about the PDO extension in the manual=0A= at http://www.php.net/manual/ref.pdo.php.=0A= =0A= 10b. Changes in MySQL support=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=0A= =0A= In PHP 4, MySQL 3 support was built-in. With the release of PHP 5.0 there=0A= were two MySQL extensions, named 'mysql' and 'mysqli', which were = designed=0A= to support MySQL < 4.1 and MySQL 4.1 and up, respectively. With the=0A= introduction of PDO, which provides a very fast interface to all the=0A= database APIs supported by PHP, the PDO_MYSQL driver can support any=0A= of the current versions (MySQL 3, 4 or 5) in PHP code written for PDO,=0A= depending on the MySQL library version used during compilation. The=0A= older MySQL extensions remain in place for reasons of back compatibility,=0A= but are not enabled by default.=0A= =0A= 10c. Changes in SQLite support=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=0A= =0A= In PHP 5.0, SQLite 2 support was provided by the built-in sqlite=0A= extension, which was also available as a PECL extension in PHP 4.3=0A= and PHP 4.4. With the introduction of PDO, the sqlite extension doubles=0A= up to act as a 'sqlite2' driver for PDO; it is due to this that the=0A= sqlite extension in PHP 5.1 has a dependency upon the PDO extension.=0A= =0A= PHP 5.1 ships with a number of alternative interfaces to sqlite:=0A= =0A= The sqlite extension provides the "classic" sqlite procedural/OO API=0A= that you may have used in prior versions of PHP. It also provides the=0A= PDO 'sqlite2' driver, which allows you to access legacy SQLite 2=0A= databases using the PDO API.=0A= =0A= PDO_SQLITE provides the 'sqlite' version 3 driver. SQLite version 3=0A= is vastly superior to SQLite version 2, but the file formats of the=0A= two versions are not compatible.=0A= =0A= If your SQLite-based project is already written and working against=0A= earlier PHP versions, then you can continue to use ext/sqlite without=0A= problems, but will need to explicitly enable both PDO and sqlite. New=0A= projects should use PDO and the 'sqlite' (version 3) driver, as this is=0A= faster than SQLite 2, has improved locking concurrency, and supports=0A= both prepared statements and binary columns natively.=0A= =0A= 11. Further migration information=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=0A= =0A= For general information about migrating from PHP 4 to PHP 5, please = refer to=0A= the relevant section in the PHP manual at = http://www.php.net/manual/migration5.php.=0A= =0A= 12. Checking for E_STRICT errors=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=0A= =0A= If you only have a single script to check, you can pick up E_STRICT=0A= errors using PHP's commandline lint facility:=0A= =0A= php -d error_reporting=3D4095 -l script_to_check.php=0A= =0A= For larger projects, the shell script below will achieve the same task:=0A= =0A= #!/bin/sh=0A= =0A= directory=3D$1=0A= =0A= shift=0A= =0A= # These extensions are checked=0A= extensions=3D"php inc"=0A= =0A= check_file ()=0A= {=0A= echo -ne "Doing PHP syntax check on $1 ..."=0A= =0A= # Options:=0A= ERRORS=3D`/www/php/bin/php -d display_errors=3D1 -d html_errors=3D0 -d = error_prepend_string=3D" " -d error_append_string=3D" " -d = error_reporting=3D4095 -l $1 | grep -v "No syntax errors detected"`=0A= =0A= if test -z "$ERRORS"; then=0A= echo -ne "OK."=0A= else=0A= echo -e "Errors found!\n$ERRORS"=0A= fi=0A= =0A= echo=0A= }=0A= =0A= # loop over remaining file args=0A= for FILE in "$@" ; do=0A= for ext in $extensions; do=0A= if echo $FILE | grep "\.$ext$" > /dev/null; then=0A= if test -f $FILE; then=0A= check_file "$FILE"=0A= fi=0A= fi=0A= done=0A= done=0A= ------=_NextPart_000_0171_01C5ED14.6C416100--