downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

$HTTP_RAW_POST_DATA> <$_COOKIE
[edit] Last updated: Fri, 17 May 2013

view this page in

$php_errormsg

$php_errormsgÖnceki hata iletisi

Açıklama

$php_errormsg PHP tarafından üretilen son hata iletisinin metnini içeren bir değişkendir. Bu değişken sadece hatanın oluştuğu alan içinde ve sadece track_errors ayar seçeneği açıldıysa (öntanımlı değeri kapalıdır) geçerlidir.

Bilginize: Bu değişken sadece php.ini içindeki track_errors yönergesi etkin olduğunda kullanılabilir.

Uyarı

Eğer bir kullanıcı tanımlı hata eylemcisi ( set_error_handler()) atanmışsa $php_errormsg değişkenine sadece hata eylemcisi FALSE döndürürse bir değer atanır.

Örnekler

Örnek 1 - $php_errormsg örneği

<?php
@strpos();
echo 
$php_errormsg;
?>

Yukarıdaki örnek şuna benzer bir çıktı üretir:

Wrong parameter count for strpos()



$HTTP_RAW_POST_DATA> <$_COOKIE
[edit] Last updated: Fri, 17 May 2013
 
add a note add a note User Contributed Notes $php_errormsg - [3 notes]
up
1
ryan kulla
4 years ago
Note: This variable doesn't seem to get populated if you're running Xdebug.
up
3
quickshiftin at gmail dot com
4 months ago
While $php_errormsg is a global, it is not a superglobal.

You'll have to qualify it with a global keyword inside a function.

<?php
function checkErrormsg()
{
    global
$php_errormsg;
    @
strpos();
    return
$php_errormsg;
}
?>
up
0
josh at karmabunny dot com dot au
1 year ago
The track_errors parameter is PHP_INI_ALL, so you can use code like this:

<?php
ini_set
('track_errors', 1);

$result = @do_risky_thing();
if (!
$result) {
    echo
'<p>Error' . htmlspecialchars($php_errormsg) . '</p>';
}

ini_set('track_errors', 0);
?>

 
show source | credits | stats | sitemap | contact | advertising | mirror sites