[PHP] Re: display_errors in DEV

2008-10-21 Thread Mike van Riel

[EMAIL PROTECTED] wrote:

Until recently, I've thought that display_errors in DEV was good

But as soon as you move into Ajax Web 2.0 world, it really doesn't cut it.

You'll never see the E_NOTICE and E_WARNING errors for Ajax, probably, and the whole 
thing might just work but you'll have plenty of buggy code.

I think it's time for the PHP team to recommend log_errors across the board.

What do you think?



You can also write a custom errorhandler which writes to a log file or 
to the syslog. I use a custom errorhandling class which registers itself 
and sends all errors (even fatals) there.
Thsi way you can have easy and quick access to errors but not the hassle 
of disruptive output.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Question about __destruct()

2008-10-21 Thread Mike van Riel

Dan Joseph wrote:

Hi,

I want to make sure I completely understand __destruct() and when its hit...

Understand that it will run if all references to a particular object are
removed, but is that also true when a page ends its execution?

Example, I call a database class.  It constructs, connects, then my page
pulls some stuff out of the database, and then the php script ends.  Does
this also cause the deconstruct to execute?



When a script ends everything is released (with some small exceptions), 
thus also all references to instances of classes.
Thus AFAIK a deconstructor will always be called at the end of script 
execution.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php