Re: question on order of variables passed to a function

From: Date: Tue, 23 Aug 2005 19:33:39 +0000
Subject: Re: question on order of variables passed to a function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-221194@lists.php.net to get a copy of this message
Vidyut Luther wrote:
<?php myErrorHandler($errno, $errstr, $errfile, $errline) { switch ($errno) { case E_USER_ERROR: ..... } ?> and then: <?php trigger_error("log(x) for x <= 0 is undefined, you used: scale = $scale", E_USER_ERROR); ?> So, wouldn't this make $errno in the "myErrorHandler" be "log (x) ...." rather than E_USER_ERROR ?
No, because you're calling trigger_error, not myErrorHandler. The order of parameters for trigger_error is as follows[1]: bool trigger_error ( string error_msg [, int error_type] ) trigger_error will, when called, either call your user-defined handler with the correct errno, errstr, errfile, errline etc, or, if you haven't defined one, it will use the error handling methods set up in PHP (log_errors or display_errors). HTH Jasper [1] http://www.php.net/trigger_error

« previous php.general (#221194) next »