1. phpdbg_break_function()을 사용하여 testFunc() 방법을 사용하세요.
프롬프트> r [/Users/zhangyue/MyDoc/博客文章/dev-blog/php/202006/source/PHPDebug互动扩展.php:11의 testFunc() 중단점 #0, 조회수: 1] >00011: 함수 testFunc(){ 00012: 글로벌 $i; 00013: $i += 3; 프롬프트> s [L12 0x109eef620 EXT_STMT /Users/zhangyue/MyDoc/博客文章/dev-blog/php/202006/source/PHPDebug互动扩展.php] >00012: 글로벌 $i; 00013: $i += 3; 00014: echo "이것은 testFunc입니다! i:" . $i, PHP_EOL; 프롬프트> s [L12 0x109eef640 BIND_GLOBAL $i "i" /Users/zhangyue/MyDoc/博客文章/dev-blog/php/202006/source/PHPDebug互动扩 확장.php] [L13 0x109eef660 EXT_STMT /Users/zhangyue/MyDoc/博客文章/dev-blog/php/202006/source/PHPDebug互动扩展.php] >00013: $i += 3; 00014: echo "이것은 testFunc입니다! i:" . $i, PHP_EOL; 00015: }
2, 直接进行了两次 s 单步, 可以看到 global $i 对应的 opcode 操work是 BIND_GLOBAL 。继续向下操作.
프롬프트> s [L13 0x109eef680 ASSIGN_ADD $i 3 /Users/zhangyue/MyDoc/博客文章/dev-blog/php/202006/source/PHPDebug互动扩 확장.php] [L14 0x109eef6a0 EXT_STMT /Users/zhangyue/MyDoc/博客文章/dev-blog/php/202006/source/PHPDebug互动扩 확장.php] >00014: echo "이것은 testFunc입니다! i:" . $i, PHP_EOL; 00015: } 00016: 프롬프트> s [L14 0x109eef6c0 CONCAT "이것은 testFunc입니다!"+ $i ~1 /Users/zhangyue/MyDoc/博客文章/dev-blog/php/202006/source/PHPDebug互动扩 확장.php] [L14 0x109eef6e0 ECHO ~1 /Users/zhangyue/MyDoc/博客文章/dev-blog/php/202006/source/PHPDebug互动扩 확장.php] testFunc 입니다! 나 : 4 [L14 0x109eef700 EXT_STMT /Users/zhangyue/MyDoc/博客文章/dev-blog/php/202006/source/PHPDebug互动扩展.php] [L14 0x109eef720 ECHO "n" /Users/zhangyue/MyDoc/博客文章/dev-blog/php/202006/source/PHPDebug互动扩 확장.php] [L15 0x109eef740 EXT_STMT /Users/zhangyue/MyDoc/博客文章/dev-blog/php/202006/source/PHPDebug互动扩展.php] >00015: } 00016: 00017: testFunc();
以上就是php방식은 大家点会后也赶快尝试下实例操操작품을 사용하는 방법입니다.