slim-php is_callable () parameters in parentheses?

Source: Internet
Author: User

See Slim source of the time to find this usage


Official Handbook


Why it's so used, $route is an object, $setOutputBuffering is a method inside

================
PS: And what is this advanced usage

Reply content:

See Slim source of the time to find this usage


Official Handbook


Why it's so used, $route is an object, $setOutputBuffering is a method inside

================
PS: And what is this advanced usage

First, the [...] square brackets are php5.4 provided after an array of short-write syntax, in fact, and array(...) the effect is the same.

Second, callable there are many ways to represent an php executable method, callable and using an array to represent it is one of them. Here [$route, 'setOutputBuffering'] is the method that represents this $route object setOutputBuffering .

The final syntax is php in the HEREDOC syntax, in fact, is a multi-line string representation method.

[$route, 'setOutputBuffering']This is commonly used incall_user_func_array

  • Related Article

    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.