国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > PHP > 正文

php調(diào)試?yán)?/h1>
2024-05-04 21:53:00
字體:
供稿:網(wǎng)友

如果我們想知道某個方法被誰調(diào)用了?  debug_print_backtrace可以解決!~
測試代碼:

  1. <?php 
  2.  class a{ 
  3.      function say($msg) { 
  4.          echo "msg:".$msg
  5.          echo "<pre>";debug_print_backtrace(); 
  6.      } 
  7.  } 
  8.   
  9.  class b { 
  10.      function say($msg) { 
  11.          $a = new a(); 
  12.          $a->say($msg); 
  13.      } 
  14.  } 
  15.   
  16.  class c { 
  17.      function __construct($msg) { 
  18.          $b = new b(); 
  19.          $b->say($msg); 
  20.      } 
  21.  } 
  22.   
  23.  $c = new c("test"); 
輸出結(jié)果:
  1. msg:test 
  2. #0  a->say(test) called at [/var/www/test/test0723.php:12] 
  3. #1  b->say(test) called at [/var/www/test/test0723.php:19] 
  4. #2  c->__construct(test) called at [/var/www/test/test0723.php:23] 
相關(guān)鏈接:
http://ch2.php.net/manual/zh/function.debug-print-backtrace.php
http://ch2.php.net/manual/zh/function.debug-backtrace.php
think in coding

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表

主站蜘蛛池模板: 紫金县| 肇庆市| 茌平县| 富宁县| 工布江达县| 三都| 溆浦县| 平谷区| 芦溪县| 阿克陶县| 曲沃县| 博兴县| 韩城市| 阿瓦提县| 崇义县| 冀州市| 威海市| 榆树市| 曲麻莱县| 绵阳市| 台安县| 云林县| 纳雍县| 水富县| 昂仁县| 烟台市| 徐水县| 玉山县| 府谷县| 平利县| 临澧县| 扶风县| 邢台县| 历史| 城市| 常宁市| 永德县| 汕头市| 建阳市| 永德县| 巫山县|