บทช่วยสอนPHP

PHP HOME แนะนำ PHP การติดตั้ง PHP PHP ไวยากรณ์ ความคิดเห็น PHP ตัวแปร PHP PHP Echo / พิมพ์ ประเภทข้อมูล PHP PHP Strings หมายเลข PHP PHP คณิตศาสตร์ ค่าคงที่ PHP ตัวดำเนินการ PHP PHP If...Else...Elseif PHP Switch PHP Loops ฟังก์ชัน PHP PHP Arrays PHP Superglobals PHP RegEx

แบบฟอร์มPHP

การจัดการแบบฟอร์ม PHP การตรวจสอบแบบฟอร์ม PHP ต้องใช้แบบฟอร์ม PHP URL แบบฟอร์ม PHP/อีเมล แบบฟอร์ม PHP เสร็จสมบูรณ์

PHPขั้นสูง

วันที่และเวลา PHP รวม PHP การจัดการไฟล์ PHP ไฟล์ PHP เปิด/อ่าน สร้าง/เขียนไฟล์ PHP อัพโหลดไฟล์ PHP คุกกี้ PHP PHP Sessions ตัวกรอง PHP ตัวกรอง PHP ขั้นสูง ฟังก์ชันเรียกกลับของ PHP PHP JSON ข้อยกเว้น PHP

PHP OOP

PHP OOP คืออะไร คลาส PHP/วัตถุ ตัวสร้าง PHP PHP Destructor PHP Access Modifiers PHP Inheritance ค่าคงที่ PHP PHP Abstract Classes อินเทอร์เฟซ PHP PHP ลักษณะ PHP Static Methods PHP คุณสมบัติคงที่ PHP เนมสเปซ PHP Iterables

ฐานข้อมูลMySQL

ฐานข้อมูล MySQL MySQL Connect MySQL สร้าง DB MySQL สร้างตาราง MySQL แทรกข้อมูล MySQL รับ ID ล่าสุด MySQL แทรกหลายรายการ MySQL ที่เตรียมไว้ MySQL Select Data MySQL Where MySQL สั่งซื้อโดย MySQL ลบข้อมูล ข้อมูลอัพเดต MySQL MySQL Limit Data

PHP XML

PHP XML Parsers PHP SimpleXML Parser PHP SimpleXML - รับ PHP XML Expat PHP XML DOM

PHP - AJAX

บทนำ AJAX AJAX PHP ฐานข้อมูล AJAX AJAX XML AJAX ค้นหาสด AJAX โพล

ตัวอย่างPHP

ตัวอย่าง PHP PHP คอมไพเลอร์ แบบทดสอบ PHP แบบฝึกหัด PHP ใบรับรอง PHP

ข้อมูลอ้างอิงPHP

ภาพรวม PHP PHP Array ปฏิทิน PHP PHP วันที่ ไดเรกทอรี PHP ข้อผิดพลาด PHP ข้อยกเว้น PHP ระบบไฟล์ PHP ตัวกรอง PHP PHP FTP PHP JSON คีย์เวิร์ด PHP PHP Libxml PHP Mail PHP คณิตศาสตร์ PHP เบ็ดเตล็ด PHP MySQLi เครือข่าย PHP การควบคุมเอาต์พุต PHP PHP RegEx PHP SimpleXML PHP Stream PHP String การจัดการตัวแปร PHP PHP XML Parser PHP Zip เขตเวลา PHP

PHP debug_backtrace ()ฟังก์ชัน

การอ้างอิงข้อผิดพลาด PHP

ตัวอย่าง

สร้าง backtrace PHP:

<?php
function a($txt) {
    b("Glenn");
}
function b($txt) {
    c("Cleveland");
}
function c($txt) {
    var_dump(debug_backtrace());
}
a("Peter");
?>

ความหมายและการใช้งาน

ฟังก์ชัน debug_backtrace() สร้าง PHP backtrace

ฟังก์ชันนี้แสดงข้อมูลจากโค้ดที่นำไปสู่ฟังก์ชัน debug_backtrace()

ส่งกลับอาร์เรย์ของอาร์เรย์ที่เชื่อมโยง องค์ประกอบที่ส่งคืนได้คือ:

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:
  • Returns: "->"  - Method call
  • Returns: "::"  - Static method call
  • Returns nothing - Function call
args array If inside a function, it lists the functions arguments. If inside an included file, it lists the included file names


ไวยากรณ์

debug_backtrace(options, limit);

ค่าพารามิเตอร์

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

รายละเอียดทางเทคนิค

คืนมูลค่า: อาเรย์ของแอสโซซิเอทีฟอาเรย์
รุ่น PHP: 4.3+
บันทึกการเปลี่ยนแปลง PHP: PHP 5.4: เพิ่ม ขีดจำกัด พารามิเตอร์ เสริมแล้ว
PHP 5.3.6: พารามิเตอร์ให้_objectถูกเปลี่ยนเป็นตัวเลือกและเพิ่มตัวเลือกเพิ่มเติม DEBUG_BACKTRACE_IGNORE_ARGS
PHP 5.2.5: เพิ่ม พารามิเตอร์ ให้_object
PHP 5.1.1: เพิ่มวัตถุปัจจุบันที่เป็นไปได้ กลับองค์ประกอบ

การอ้างอิงข้อผิดพลาด PHP