你可以
register一
tick handler:
Ticks
A tick is an event that occurs for every N low-level tickable statements executed by the parser within the declare block. The value for N is specified using ticks=N within the declare blocks’s directive section.
Not all statements are tickable. Typically,condition expressions and argument expressions are not tickable.
正如您所看到的,它不完全是“每行代码”,除非您每行只写一个可选择的语句.但它是你能得到的最接近的.
例:
declare(ticks=1); register_tick_function(function() { echo "tick_handler() called\n"; }); echo 'Line 1',PHP_EOL; echo 'Line 2',PHP_EOL; echo strtoupper('Line 3'),PHP_EOL;
tick_handler() called Line 1 tick_handler() called Line 2 tick_handler() called LINE 3 tick_handler() called
原文地址:https://www.jb51.cc/php/240123.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。