PHP debug_backtrace() ফাংশন
উদাহরণ
পিএইচপি ব্যাকট্রেস তৈরি করুন:
<?php function a($txt) { b("Glenn"); } function b($txt) { c("Cleveland"); } function c($txt) { var_dump(debug_backtrace()); } a("Peter"); ?>
এই কোডের আউটপুট এইরকম হতে পারে:
Array ( [0] => Array ( [file] => C:\webfolder\test.php [line] => 6 [function] => c [args] => Array ( [0] => Cleveland ) ) [1] => Array ( [file] => C:\webfolder\test.php [line] => 3 [function] => b [args] => Array ( [0] => Glenn ) ) [2] => Array ( [file] => C:\webfolder\test.php [line] => 11 [function] => a [args] => Array ( [0] => Peter ) ) )
সংজ্ঞা ও ব্যবহার
debug_backtrace() ফাংশন ব্যাকট্রেস (পুনরাবৃত্তি ট্র্যাক) তৈরি করে。
এই ফাংশন ডিবাগ_ব্যাকট্রেস() ফাংশনের কোড থেকে তৈরি হওয়া ডাটা দেখায়。
একটি সংযুক্ত আইসকেজ ফলাফল প্রদান করে।প্রদানকৃত উপাদানগুলি হতে পারে:
Name | Type | Description |
---|---|---|
function | string | Current function name |
line | integer | Current line number |
file | string | Current file name |
class | string | Current class name |
object | object | Current object |
type | string |
Current call type. Possible calls:
|
args | array | If in a function, list function parameters. If in the referenced file, list the name of the referenced file. |
Syntax
debug_backtrace(options,limit);
Parameter | Description |
---|---|
options |
Optional. Specify the bitmask for the following options:
|
limit | Optional. Limit the number of returned stack frames. The default is (limit=0) Returns all stack frames. |
Technical Details
Return Value: | None |
---|---|
PHP Version: | 4.3+ |
PHP Update Log |
PHP 5.4: Added optional parameters limit. PHP 5.3.6: Parameter provide_object changed to optionsand added optional parameter DEBUG_BACKTRACE_IGNORE_ARGS. PHP 5.2.5: Added optional parameters provide_object. PHP 5.1.1: Added the current object For possible returned elements. |