note 110013 added to class.errorexception

From: Date: Wed, 12 Sep 2012 02:49:46 +0000
Subject: note 110013 added to class.errorexception
Groups: php.notes 
Request: Send a blank email to php-notes+get-190630@lists.php.net to get a copy of this message
I believe the example code before vog at notjusthosting dot com commented on 2 may 2011 should be: <?php function exception_error_handler($errno, $errstr, $errfile, $errline ) { throw new ErrorException($errstr, 0, $errno, $errfile, $errline); } set_error_handler("exception_error_handler"); /* Trigger exception */ strpos(); ?> And the one suggested by vog should be incorrect with the following reasons. As in the manual page of set_error_handler(), "the first parameter, errno, contains the level of the error raised, as an integer". This should be the same meaning as the severity of ErrorException. Meanwhile, severity is the only property that added to ErrorException, making it different from Exception. It only makes sense if severity is set for any ErrorException. And the default value for severity is one but not zero. Others had used other variable names in comments, but the parameter sequence is different from vog. ---- Server IP: 203.169.204.174 Probable Submitter: 124.244.171.10 ---- Manual Page -- http://www.php.net/manual/en/class.errorexception.php Edit -- https://master.php.net/note/edit/110013 Del: integrated -- https://master.php.net/note/delete/110013/integrated Del: useless -- https://master.php.net/note/delete/110013/useless Del: bad code -- https://master.php.net/note/delete/110013/bad+code Del: spam -- https://master.php.net/note/delete/110013/spam Del: non-english -- https://master.php.net/note/delete/110013/non-english Del: in docs -- https://master.php.net/note/delete/110013/in+docs Del: other reasons-- https://master.php.net/note/delete/110013 Reject -- https://master.php.net/note/reject/110013 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#190630) next »