How to get error context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

i need help because I'm unable to retrieve error's context. Below is the code that is working perfectly except the context that is not displayed:

<?php
    function error_handler($errno, $errstr, $filename, $lineno, $errcontext)
    {
        
          
        $str = "";
        $str .= "<br><br>ERROR Number: ". $errno;
        $str .= "<br>ERROR MESSAGE: ". $errstr;
        $str.= "<br>File: ". $filename;
        $str.= "<br>Line number: ". $lineno;
        $str.= "<br>Context: ". $errcontext[0];
        echo $str;
        

    }

echo "<h1>Testing set_error_handler</h1>";

error_reporting(0);  
set_error_handler('error_handler'); 
ini_set('error_reporting', 0);

//trigger_error("The string for testing the error", E_USER_WARNING);
$ourFileName = "testFile.txt";
$fh = fopen($ourFileName, 'X');// or die("Can't open file");
fclose($fh);


?>




      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux