note 75169 deleted from function.set-error-handler by cmb

From: Date: Sun, 25 Aug 2019 08:54:40 +0000
Subject: note 75169 deleted from function.set-error-handler by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-211982@lists.php.net to get a copy of this message
Note Submitter: greg sidberry[poetics5 at yahoo dot com] ---- I was using a class, and needed to have a function within it handle php errors. The following code will allow you to call a class function of already defined object while maintaining access to all the objects current data . ============================ set_error_handler("classPassPHPError"); $ObjectName="test"; $test->new className; function classPassPHPError($errno, $errstr, $errfile, $errline){ global $ObjectName; eval("global \$".$ObjectName.";"); eval("\$object=\$".$ObjectName.";"); $object->phpErrorHandler($errno, $errstr, $errfile, $errline); $object=null; }

« previous php.notes (#211982) next »