| Home / Section index | www.icosaedro.it | ![]() |
PHPLint - Latest changesThis is only a partial list that reports changes in the 5 last published versions of the program. The complete list is available in the file CHANGES of the distributed package.
Version 0.9-20090802:
====================
Fixed bugs:
+ Namespace resolution: `use' declarations are applied to bare identifiers only
if are classes; bare identifiers of constants and functions are not resolved
with `use'.
+ $obj[INDEX] on object implementing ArrayAccess: search offsetGet() method
also between extended and implemented classes.
+ foreach($obj ...) on object implementing Iterator or IteratorAggregate:
search magic methods also between extended and implemented classes.
+ Check forbidden DocBlock line tags in class constant, property, method.
+ Implementation of concrete and abstract classes declared forward: the forward
declaration and the actual declaration must have the same attributes private,
abstract, final and unchecked; moreover, if the forward declaration extends a
class, then the actual declaration must extend the same exact class too.
+ Attributes of classes must match their forward declaration.
+ The `echo' statement, the `print' statement, the `.=' assignment operator
and the `.' operator now accept objects that implement __toString().
+ The `print' statement accepts any simple type, not only strings.
+ PHP 4, DocBlock: {@link} can make forward references because these are
resolved only at the end of the package. Instead, in PHP 5 still reference
must be resolvable in place because there are the namespace/ operator and the
`use' declarations to be applied.
+ PHP 4: modules mysql, mysqli and tidy corrected for PHP 4.
+ DocBlocks:
+ In <pre> block, retains leading spaces in lines.
+ Empty lines are properly rendered as paragraph separators.
PHPLint specific features:
+ Checked exceptions MUST be declared either in the `throws' PHPLint meta-code
or in the `@throws' line tag DocBlock. Actual functions and actual methods
that implement a prototype must be declare a compatible set of thrown checked
exceptions.
+ Methods that implements abstract methods or that override inherited methods
must declare a compatible set of thrown exceptions. Uncought checked
exceptions in global scope are signaled with a Warning. Uncought checked
exceptions in function or method must be declared thrown.
+ New meta-code attribute `unchecked' marks exceptions that are unchecked:
/*. unchecked .*/ class MyException extends Exception {}
Unchecked exceptions are just like any other exception, but catching them is
not mandatory. Uncought unchecked exceptions are not signaled anymore.
Exceptions extending unchecked exceptions must be unchecked.
Classes `Exception' and `ErrorExceptions' are checked exceptions.
Exceptions declared in the SPL module are all unchecked.
+ Documentator: for functions and methods, prints a short line that lists all
the checked exceptions thrown, and a detailed list with all the checked and
unchecked exceptions for which a description is available.
+ Variables used to catch exceptions as $e in catch(SomeException $e) changes
their type from a catch() branch to the other, so them are handled in a
special way: 1. cannot be already in use entering the catch() branch and 2.
are deleted exiting from the catch() branch so that can be re-used. Flaw: if
try/catch statements appear in global scope the generated document contains
some private variables named $catch#1, $catch#2, etc. as an artifact.
+ Updated modules: dom, mysql, mysqli, spl, standard_reflection, tidy.
Version 0.9-20090714:
====================
Fixed bugs:
+ Fixed bug in DocBlock: line tags are now allowed also in DESCR field.
+ Fixed bug in error messages reporting non-ASCII characters (actually a bug
in the m2runtime.StringToLiteral function corrected in the new release of
the M2 development system).
PHP syntax:
+ Namespaces (PHP 5.3):
+ Add "namespace" statement.
+ Add "namespace" operator.
+ Add "use" statement.
+ Add "const" statement.
+ Add support for autoloading of classes with __autoload().
+ Support for namespaces in DocBlock.
+ Short tags <? and <?= are now deprecated, use <?php instead.
+ Double-quoted string: added new escape sequences \v \f.
+ Now-doc with double-quoted label and here-doc now supported (PHP 5.3).
+ Parse (but ignores) declare(encoding='xxx').
PHPLint specific features:
+ Packages are now classified as: modules, libraries and programs (see the
reference manual for details).
+ Class autoloading with __autoload() and the /*.pragma 'autoload'.*/ PHPLint
meta-code (see the reference manual for details).
+ Detects unsupported BOM leading bytes in source files. ASCII, ISO-8859 and
UTF-8 without BOM are the only allowed encodings for PHP sources.
+ Detects duplicated labels in `case' branches.
+ Magic constants are resolved into dynamically determinated values: __DIR__,
__FILE__, __LINE__, __NAMESPACE__, __FUNCTION__, __CLASS__, __METHOD__.
Expressions whose value can be determinated statically are then allowed also
in statements as in
require_once __DIR__."/autoload.php";
which can be useful for CLI scripts where the CWD is set to the user's CWD.
+ For properties whose type does not allow the NULL value (that is boolean,
int and float) the initial value must be specified otherwise PHP would
initialize them to the invalid value NULL. Then, for example:
private $n = 0;
private /*. string .*/ $s;
+ For static local variables whose type does not allow the NULL value (that
is boolean, int and float) the initial value must be specified otherwise PHP
would initialize them to the invalid value NULL. Then, for example:
static $count = 0;
static /*. string .*/ $prefix;
+ Concrete classes that implement Traversable must also implement either
Iterator or IteratorAggregate, not both (Jirka Grunt).
+ Added new attribute `return' for arguments of function that return a value by
reference, in addition to the arguments by value and arguments by reference
that already exists in PHP.
+ $obj[INDEX] for $obj implementing ArrayAccess is allowed, with INDEX of any
type (the implemented methods should take care to perform any required
check). The resulting value is the type returned by offsetGet(); since this
method return mixed in its definition, only string, array, resource and
objects are allowed as overriding return types. Then bool, int and float
still have to be returned boxed inside a `mixed'. (Jirka Grunt)
+ foreach($obj as $k => $v): if $obj implements Iterator or IteratorAggregate,
the type of $k is the return type of the implemented Iterator::key() method
and the type of $v is the return type of the implemented Iterator::current()
method; since key() and current() both returns mixed in their definition,
only string, array, resource and objects are allowed as overriding return
types. Then bool, int and float still have to be returned boxed inside a
`mixed'.
+ Flow analysis: handles special cases if(EXPR), while(EXPR), do...while(EXPR)
whenever EXPR can be statically evaluated to TRUE or FALSE.
+ Definitely assigned variables detection. This feature is under
development and it is still incomplete: it assumes the variables
conditionally assigned in expressions as definitely assigned, which is not
the case as in if(true or ($i = 3) > 0) echo $i; where $i is never assigned.
+ Updated modules: cpdf, dom, gmp, hash, json, ldap, libxml, mysql, mysqli,
ncurses, oci, openssl, pcntl, pcre, pdo, regex, sockets, spl (Jirka Grunt),
standard, sysvmsg, tidy, xml, xmlreader.
+ phplint.tk: fixed editor setting.
Version 0.8-20090517:
====================
+ Perform static flow analysis and detect unreachable code and missing return
statements.
+ In `switch' statement: `case' branches and `default' branch now allowed
in any order (previously `default' had to be the last).
+ Compound statement {...} now allowed.
+ phpDocumentator DocBlock:
+ Fixed bug in list rendering.
+ Added inline tag {@link}.
+ Added <kbd> speudo-HTML entity.
+ Short description now allows speudo-HTML entities and inline tags.
+ Unimplemented and unknown line tags and inline tags are signaled and then
rendered verbatim.
+ Added option --[no-]is-module.
+ Updated modules: pdo, spl, standard.
Version 0.8-20090428:
====================
+ Bug fix: in some cases did not correctly built inheritance path of
extended/implemented methods, causing a program abort.
+ Bug fix: inherited abstract methods cannot be redeclared as abstract
(PHP restriction).
+ Bug fix: detects circular references in class declarations.
+ Detects redundant class extension and implementation of classes that are
already in the inheritance tree of the class or interface being declared.
+ Prototypes: `extends' for concrete and abstract classes now supported
(`implements' still is not) (Jirka Grunt).
+ Prototypes: interface prototypes now supported (but `extends' still
unimplemented) (Jirka Grunt).
+ DocBlock: @throws line tag added (extension to phpDocumentator commonly
accepted) (Jirka Grunt).
+ `final' special methods (__construct, __set, __get, ...) now allowed (Jirka
Grunt).
+ Documentator: fully documents class hierarchy with inheritance tree.
+ Documentator: fully documents descriptions of thrown exceptions (see @throws).
+ Updated modules: curl, ftp, gd, mhash, mysqli, standard (Jirka Grunt),
spl (Jirka Grunt), standard_reflection, variant.
+ Added modules: xdebug (Jirka Grunt).
Version 0.8-20090102:
====================
+ Class constants now support the visibility flags as meta-code (Jirka Grunt).
+ "... instanceof $str | $obj" now supported (Jirka Grunt).
+ "... instanceof self" and "... instanceof parent" now supported.
+ "new CLASS_NAME();" is now accepted as valid statement.
+ Constructor signature now allowed in interfaces as required by PHP >= 5.2.0
(Jirka Grunt).
+ Relaxed signature compatibility rule: sub-classes allowed.
+ Missing ?> at the end of the file now allowed (Jirka Grunt).
+ Removed the dummy type `number' because it is not a proper PHP type; use
`float' instead.
+ Exceptions:
+ Added meta-code 'throws' declaration for functions, methods and protos.
+ Checks exceptions inherited from overridden and implemented methods.
+ Checks branches in try...catch statement.
+ In DocBlock: lines missing the leading `*' are ignored, but following lines
are handled correctly (fix).
+ Standard module: changed `number' with `float'.
+ Modules mysqli, readline, session, standard: calbacks are now `mixed'
to support for both functions and methods (Jirka Grunt).
+ Updated modules: standard_reflection, spl.
This is only a partial list that reports changes in the 5 last published versions of the program. The complete list is available in the file CHANGES of the distributed package.
| Umberto Salsi | Contact | Site map | Home / Section index |