Re: [PHP4BETA] Php4 and warnings

From: Date: Fri, 28 Jan 2000 13:16:57 +0000
Subject: Re: [PHP4BETA] Php4 and warnings
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-9512@lists.php.net to get a copy of this message
Stig Bakken wrote: > On Fri, 28 Jan 2000, Turcu Mihai wrote: > > | I've got some anoying warnings from time to time, and now I can't acces > | my php site at all because of them. There are something like: "Warning: > | Use of undefined constant user - assumed 'blabla' ". It works just fine > | in php3 and from time to time in php4b3. Can I disable them somehow ? I > | tried to disable warnings from php.ini but still the same. I must > | declare all variables in php4 before I use them ? > | > | I am using php4b3 and Apache 1.3.9. > > It sounds like you have some unquoted strings in your code. For example: > > $a = user; > > It's hard to tell without having you show the code on the line that causes > this warning, though. > > - Stig > Here is an example: $display_edit_fields_name[n]=array("Objektart:","zu:", "Bundesland:", "PLZ:", "Landkreis (KFZ-Kennzeichen):", "Ort:", "Straße:", "Baujahr:(YY-MM-DD)", "Wohnfläche:", "", "Nutzfläche:", "", "Grundstück:", "", "Zimmerzahl:","Anzahl der Geschosse:", "Garage / Stellplätze:", "Bezug ab:(YY-MM-DD)", "Preis:", "", "Beschreibung/Ausstattung:", "Lage/Umgebung:","Email:","Weitere Kontaktinformationen:","Paßwort:" ); $display_edit_fields_name[dealer]=array("Objektart:","zu:", "Bundesland:", "PLZ:", "Landkreis (KFZ-Kennzeichen):", "Ort:", "Straße:", "Baujahr:(YY-MM-DD)", "Wohnfläche:", "Nutzfläche:", "Grundstück:", "", "Zimmerzahl:","Anzahl der Geschosse:", "Garage / Stellplätze:", "Bezug ab:(YY-MM-DD)","Preis:", "", "Beschreibung/Ausstattung:", "Lage/Umgebung:" ); Here is about "n" and "dealer". Worked fine in php3. Or: session_register("count"); $count++; Here is about "count". Anyway, I managed to get rid of the warnings. I disabled the parser errors from php.ini. But shouldn't these warnings apear only when I set error_reporting = +8 ??? (8 = Notices - warnings you can ignore, but sometimes imply a bug (e.g., using an uninitialized variable)). Now I have error_reporting = 1. Mita

« previous php.version4 (#9512) next »