question on order of variables passed to a function
| From: | Vidyut Luther | Date: | Tue, 23 Aug 2005 15:38:37 +0000 |
| Subject: | question on order of variables passed to a function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-221178@lists.php.net to get a copy of this message | ||
I'm writing a error handler for my scripts, so I went to : http://us3.php.net/manual/en/function.set-error-handler.php
I noticed something in the example 1 given there.
<?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 ?
is this a typo on the website ? or am I not understanding how variables are passed to a function ? I always thought the
variables needed to be passed in the same order as the signature of the function..