note 41108 added to function.set-error-handler

From: Date: Tue, 30 Mar 2004 12:23:31 +0000
Subject: note 41108 added to function.set-error-handler
Groups: php.notes 
Request: Send a blank email to php-notes+get-67374@lists.php.net to get a copy of this message
@skyrl at free dot fr It seems that the reference operator '&' doesn't have any effect. That's why I submitted the comment. <?php class error { var $error; function error() { $this->setIni(); } function handler() { echo $this->error.'!!'; } function setText($text) { $this->error = $text; } function setIni() { set_error_handler(array(&$this, 'handler')); // The '&' operator doesn't have any effect } } $eh = new error; $eh->setText('Error! <br>'); // Will not get set trigger_error('text', E_USER_ERROR); // prints '!!' ?> Proof of concept http://trouby.digitized.nl/set_error_handler.php http://trouby.digitized.nl/set_error_handler.php?source=1 ---- Manual Page -- http://www.php.net/manual/en/function.set-error-handler.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+41108 Delete -- http://master.php.net/manage/user-notes.php?action=delete+41108&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+41108&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#67374) next »