Skip to content

Il sito di Ivan Piffer

Narrow screen resolution Wide screen resolution Increase font size Decrease font size Default font size    Default color brown color green color red color blue color
You are here: HOME arrow Informatica arrow Software arrow Una funzione per il debug in PHP
Skip to content
Una funzione per il debug in PHP PDF Stampa E-mail
Valutazione utente: / 0
ScarsoOttimo 
Scritto da Ivan Piffer   
mercoledì 19 dicembre 2007

Un esempio da manuale per l'arte che le poche di righe di codice dimostra; quando vedo queste cose VERAMENTE penso alla genialita' che si puo' dimostrare in IT.

The image “http://blog.assembleron.com/wp-content/2007/08/grandadcoder.jpg” cannot be displayed, because it contains errors.

Despite the proliferation of debugging tools, especially real-time debuggers, “debugging by print statement” remains the most common form of debugging in most programming languages. It’s especially important when you run into a fatal error on a production server that you can’t use a real-time debugger on, display_errors is Off, and you can’t take the server down to test something (which is the only place that the most critical bugs appear, according to Murphy). Of course, even if you can hide debug statements throughout the code without the user knowing you still need to know which is which in order to trace code execution. (You wouldn’t believe the number of times I’ve had to do that to deal with weirdly configured servers.)

PHP offers __FILE__ and __LINE__ magic constants to show where a given line is executed, and you can always wrap a print statement in a “display:none” div, but that’s a lot of extra code to write or copy to everywhere you just want to know the status of a variable. Many frameworks offer their own debugging framework, but those don’t help if you’re not using that framework. Centralizing that code breaks the __FILE__ and __LINE__ constants. Now what?....

Guardate in codice della funzione nel link dell'articolo!!!

 ecco qui

 

 

 

Commenti
Nuovo Cerca RSS
Commenta
Nome:
Email:
 
Website:
Titolo:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."


 
< Prec.   Pros. >