PHP code Debugging and testing

Source: Internet
Author: User
>php does not have multi-threading, synchronization and other complex concepts, mostly composed of functions and classes, data types and syntax is relatively simple, using its rich built-in functions to achieve most of the functional testing, but sometimes also need to compare professional debugging methods and tools to quickly catch the exception. (1) The Debug function in practice, in addition to the application of Echo, die, var_dump output the current variable value, but also need to output some additional information, such as the current code is located in the function name. Let's take a look at three functions for debugging: **func_num_args () * * This function returns the number of arguments for the current function returned by the number **func_get_arg () * * function returns the value of the parameter at the specified position **func_get_args () * * This function returns an array containing all the parameters of the current function **php_eol PHP can use Php_eol instead of line breaks to improve the code-level portability of codes like usual and directory_separator can use functions Get_defined_ Constants () to get all PHP constants "
 
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.