View Discussion Improve Article Save Article View Discussion Improve Article Save Article The is_callable() function is an inbuilt function in PHP which is used to verify the contents of a variable can be called as a function. It can check that a simple variable contains the name of a valid function, or that an array contains a properly encoded object and function name. Syntax: bool is_callable ( $variable_name, $syntax_only, $callable_name ) Parameters: The is_callable() function accepts three parameters as shown in above syntax and are described below. It depends on user to use how many parameters one, two or three.
Return value: This function returns a boolean type value. It returns TRUE if $variable_name is callable, FALSE otherwise. Below program illustrate the is_callable() function in PHP:
Output: bool(true) Function_xyz bool(true) Program 2: Array contains a method
Output: bool(true) ClassA::Method_xyz Reference: http://php.net/manual/en/function.is-callable.php LOL I figured that would get your attention, what the hell are you doing Spuds. Its the dispatcher, the hook processor and the special front page hook areas. All of the other uses that I've seen are using the call on an object, not a string. I changed the other areas to use the The only other 8.0 issue of note is in the event manager. PHP 8 will stop dead if you pass parameters to a method that accepts none (and presumably wrongly named / ordered ones). So I did a little dance with
Which will ensure no parameters are sent to a method that uses none. Dirty but seemed like an easy fix. In 2.0 could use this to ensure the parameter names match what is expected, log errors, etc etc Anyway have to run to the store now, my neighbor has the old corona-mona and needs some stuff so off I go! |