"PHP debug backtrace()"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-== 참고 자료 == +==참고==))
69번째 줄: 69번째 줄:
*[[백트레이스]]
*[[백트레이스]]


==참고 자료==
==참고==
* http://php.net/manual/kr/function.debug-backtrace.php
* http://php.net/manual/kr/function.debug-backtrace.php


[[분류: PHP]]
[[분류: PHP]]

2017년 6월 27일 (화) 12:23 판

1 개요

PHP debug_backtrace()
  • 디버그 역추적정보 배열을 반환하는 PHP 함수

2 예시: include 구조

a.php
<?php
function foo() {
	print_r( debug_backtrace() );
}
foo();
실행결과
root@zetawiki:~# php a.php
Array
(
    [0] => Array
        (
            [file] => /root/a.php
            [line] => 5
            [function] => foo
            [args] => Array
                (
                )
        )
)
b.php
<?php
include 'a.php';
실행결과
root@zetawiki:~# php b.php
Array
(
    [0] => Array
        (
            [file] => /root/a.php
            [line] => 5
            [function] => foo
            [args] => Array
                (
                )
        )
    [1] => Array
        (
            [file] => /root/b.php
            [line] => 2
            [args] => Array
                (
                    [0] => /root/a.php
                )
            [function] => include
        )
)

3 같이 보기

4 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}