Home  >  Article  >  Backend Development  >  FirePHP recommends a PHP debugging tool_PHP tutorial

FirePHP recommends a PHP debugging tool_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:30:141097browse

There are many methods for PHP debugging. What I recommend to you today is FirePHP (http://www.firephp.org/).

This tool is based on a component of firefox. Firephp component installation address. You need to install this component before using it. After that, you still need to down a FirePHP package. Download address.

After the download is completed, you can see the files in the package as follows:

Let’s write an example to test now. (You need to include the fb.php file) The code is as follows:

We run under firefox. The results are as follows:
firephp - 3

You can see the value of $str here.

Next, let’s introduce some common methods of FirePHP:

1. fb($para) This method is the example above. The value of a variable can be monitored. This method is equivalent to FB::log($para).

2. FB::info ($str); This method is similar to the fb() method. The difference is that the running result will have a different logo in firefox. (See picture 3)

3. FB::warn($str); Similar to the above.

4. FB::error($str); Similar to the above.


Picture 3

5. FB::trace($str); This method is used to monitor the call stack of variables. See the example below.

We can also use FB in classes. The following example:

The running results are as follows:
firephp

In fb.php, we can see that there are many methods as follows, which will not be introduced one by one here. The main commonly used ones are the above five. Interested students can carefully study and test other methods.

firephp

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323253.htmlTechArticleThere are many methods for PHP debugging. What I recommend to you today is FirePHP (http://www.firephp.org/). This tool is based on a component of firefox. Firephp component installation address. Use it...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn