Req #22296 [Opn->Bgs]: PEAR::setErrorHandling() must return previous Error handling state

From: Date: Sat, 01 Jan 2011 00:22:53 +0000
Subject: Req #22296 [Opn->Bgs]: PEAR::setErrorHandling() must return previous Error handling state
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-157456@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=22296&edit=1 ID: 22296 Updated by: jani@php.net Reported by: pbougrier at micropole-univers dot com Summary: PEAR::setErrorHandling() must return previous Error handling state -Status: Open +Status: Bogus Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: WIN2000 PHP Version: 4.3.0 Block user comment: N Private report: N New Comment: PEAR errors are reported at http://pear.php.net/bugs/ Previous Comments: ------------------------------------------------------------------------ [2003-02-19 05:08:20] pbougrier at micropole-univers dot com Say we have a global inherited PEAR object (e.g. "$foo"), created in another script with a ErrorHandling state we don't know. In our script, we have a critical section where this object must die if an error occurs : <? // begin of critical section $foo->setErrorHandling(PEAR_ERROR_DIE); // ... doing critical things // end of critical section. previous error handler must be reactivated, but, hey, who is it ? $foo->setErrorHandling(?); ?> Solution : setErrorHandling() must return a "thing" which handle the previous error handling state. <? // begin of critical section $previousErrorHandlingState = $foo->setErrorHandling(PEAR_ERROR_DIE); // ... doing critical things // end of critical section. previous error handler must be reactivated, and we know it. $foo->setErrorHandling($previousErrorHandlingState); ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=22296&edit=1

« previous php.bugs (#157456) next »