You are here: question on order of variables passed to a function « PHP « IT news, forums, messages
question on order of variables passed to a function

Posted by Vidyut Luther on 08/23/05 18:38

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..

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация