Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40531 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65333 invoked from network); 16 Sep 2008 12:31:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Sep 2008 12:31:21 -0000 Authentication-Results: pb1.pair.com header.from=vrana@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=vrana@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 208.84.148.239 as permitted sender) X-PHP-List-Original-Sender: vrana@php.net X-Host-Fingerprint: 208.84.148.239 bubetka.logix.cz Received: from [208.84.148.239] ([208.84.148.239:48589] helo=maxipes.logix.cz) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0C/3C-30574-717AFC84 for ; Tue, 16 Sep 2008 08:31:20 -0400 Received: from NETC245 (unknown [193.85.202.210]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by maxipes.logix.cz (Postfix) with ESMTP id CD1563398040 for ; Tue, 16 Sep 2008 05:31:16 -0700 (PDT) Date: Tue, 16 Sep 2008 14:31:09 +0200 X-Priority: 3 (Normal) Message-ID: <1777108503.20080916143109@vrana.cz> To: internals@lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Subject: php-initialized From: vrana@php.net (Jakub Vrana) Hello! PHP allows to work with uninitialized variables. E_NOTICE error level can be used to warn before it but this is not perfect for two reasons: 1. E_NOTICE doesn't warn before adding elements to uninitialized arrays. It is further explained by Etienne Kneuss: http://www.colder.ch/news/09-09-2005/4/another-example-showing-t.html 2. E_NOTICE is emitted in a run-time and not in a compile-time which can be late (the error is spotted in the same time as abused). To solve both problems, I've developed a program checking the usage of uninitialized variables from outside the script without running it: http://code.google.com/p/php-initialized/ Maybe the same concept can be used in the PHP compile-time. Jakub Vrana