Php callback function (callback)

Source: Internet
Author: User
The following content of the php callback function (callback) is from the official php.net documentation.

Callbacks

Call_user_func (), usort (), and other functions use custom callback functions as parameters.

Callback functions can be not only simple functions, but also object methods, including static methods of objects.

Php functions can be called by function names of the string type. any built-in or user-defined functions can be used.

Php language structure, such as: array (), echo, empty (), eval (), exit (), isset (), list (), print, unset ()

The method of the call class is to call the instantiated object and the name of the call method as the 0th and 1st parameters of the array respectively.

You can call a static method of a class without instantiating the class object. Instead, you can call the class name and the static method name as the 0th and 1st parameters of the array respectively.

After php5.2.3, you can also call the static method of this class by using ClassName: methodName.

In addition to these general user-defined functions, anonymous functions can also be used as function parameters.


  

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.