Hallo,
ich mache gerade meine ersten Schritte in PHP. Mich stört dieses Konzept der Notices und Warnings. Kann man den PHP-Interpreter irgendwie so konfigurieren, dass er das Programm abbricht, wenn er eine Notice schmeißen würde. Also so, wie sich andere (,zumindest mir alle bekannten) Programmiersprachen verhalten?
Eingabe:
  
$t = 2;  
print_r($x);  
print_r($t);  
  
Ausgabe  
PHP Notice:  Undefined variable: x in php shell code on line 1  
2
Das hat mich schon seeehr erstaunt... noch mehr erstaunt hat mich dies hier:
Eingabe:
  
if(test) echo "test existiert";  
Ausgabe:
PHP Notice:  Use of undefined constant test - assumed 'test' in php shell code on line 1  
test existiert
Das finde ich ja schon grob fahrlässig. Dieses Verhalten möchte ich also nicht. Ich möchte, dass der PHP-Interpreter bei bei einer notice oder warning aussteigt und nicht irgendwass "assumed". Geht das irgendwie?
 nicht angemeldet
 nicht angemeldet Matthias Apsel
 Matthias Apsel Der Martin
 Der Martin