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