PHP debug_backtrace() İşlevi
Örnek
Bir PHP geri izlemesi oluşturun:
<?php
function a($txt) {
b("Glenn");
}
function b($txt) {
c("Cleveland");
}
function c($txt) {
var_dump(debug_backtrace());
}
a("Peter");
?>
Tanım ve Kullanım
debug_backtrace() işlevi, bir PHP geri izlemesi oluşturur.
Bu işlev, debug_backtrace() işlevine giden koddaki verileri görüntüler.
İlişkili dizilerden oluşan bir dizi döndürür. Olası döndürülen öğeler şunlardır:
Name | Type | Description |
---|---|---|
function | string | The current function name |
line | integer | The current line number |
file | string | The current file name |
class | string | The current class name |
object | object | The current object |
type | string | The current call type. Possible calls:
|
args | array | If inside a function, it lists the functions arguments. If inside an included file, it lists the included file names |
Sözdizimi
debug_backtrace(options, limit);
Parametre Değerleri
Parameter | Description |
---|---|
options | Optional. Specifies a bitmask for the following options: DEBUG_BACKTRACE_PROVIDE_OBJECT (Whether or not to populate the "object" index DEBUG_BACKTRACE_IGNORE_ARGS (Whether or not to omit the "args" index, and all the function/method arguments, to save memory) |
limit | Optional. Limits the number of stack frames printed. By default (limit=0) it prints all stack frames |
Teknik detaylar
Geri dönüş değeri: | Bir dizi ilişkisel dizi |
---|---|
PHP Sürümü: | 4.3+ |
PHP Değişiklik Günlüğü: | PHP 5.4: İsteğe bağlı parametre sınırı eklendi PHP 5.3.6: Sağlayıcı_nesne parametresi seçenekler olarak değiştirildi ve DEBUG_BACKTRACE_IGNORE_ARGS ek seçeneği eklendi PHP 5.2.5: İsteğe bağlı sağlayıcı_nesne parametresi eklendi PHP 5.1.1: Mümkünse geçerli nesne eklendi dönüş elemanı |
PHP Hata Referansı