php - 修改标准函数

时间:2012-02-10 17:04:36

标签: php

  

可能重复:
  Redefine Built in PHP Functions

我需要覆盖php的一个标准函数。在javascript中,我会这样做:

    <script type="text/javascript">
        window.alert = function(str) {
            document.write(str);
        }
        alert("hello");
    </script>

是否可以在php中执行此操作?

2 个答案:

答案 0 :(得分:1)

使用Advanced PHP Debugger PECL扩展名。请参阅override_function()文档。

答案 1 :(得分:0)

不,有一个PHP模块可以做到这一点,但通常没有。

override_function of the APD module