Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

forward_static_call_array(3) [php man page]

FORWARD_STATIC_CALL_ARRAY(3)						 1					      FORWARD_STATIC_CALL_ARRAY(3)

forward_static_call_array - Call a static method and pass the arguments as array

SYNOPSIS
mixed forward_static_call_array (callable $function, array $parameters) DESCRIPTION
Calls a user defined function or method given by the $function parameter. This function must be called within a method context, it can't be used outside a class. It uses the late static binding. All arguments of the forwarded method are passed as values, and as an array, sim- ilarly to call_user_func_array(3). PARAMETERS
o $function - The function or method to be called. This parameter may be an array, with the name of the class, and the method, or a string, with a function name. o $parameter - One parameter, gathering all the method parameter in one array. Note Note that the parameters for forward_static_call_array(3) are not passed by reference. RETURN VALUES
Returns the function result, or FALSE on error. EXAMPLES
Example #1 forward_static_call_array(3) example <?php class A { const NAME = 'A'; public static function test() { $args = func_get_args(); echo static::NAME, " ".join(',', $args)." "; } } class B extends A { const NAME = 'B'; public static function test() { echo self::NAME, " "; forward_static_call_array(array('A', 'test'), array('more', 'args')); forward_static_call_array( 'test', array('other', 'args')); } } B::test('foo'); function test() { $args = func_get_args(); echo "C ".join(',', $args)." "; } ?> The above example will output: B B more,args C other,args SEE ALSO
forward_static_call(3), call_user_func(3), call_user_func_array(3), is_callable(3), information about the callback type. PHP Documentation Group FORWARD_STATIC_CALL_ARRAY(3)

Check Out this Related Man Page

Net::DBus::Callback(3pm)				User Contributed Perl Documentation				  Net::DBus::Callback(3pm)

NAME
Net::DBus::Callback - a callback for receiving reactor events SYNOPSIS
use Net::DBus::Callback; # Assume we have a 'terminal' object and its got a method # to be invoked everytime there is input on its terminal. # # To create a callback to invoke this method one might use my $cb = Net::DBus::Callback->new(object => $terminal, method => "handle_stdio"); # Whatever is monitoring the stdio channel, would then # invoke the callback, perhaps passing in a parameter with # some 'interesting' data, such as number of bytes available $cb->invoke($nbytes) #... which results in a call to # $terminal->handle_stdio($nbytes) DESCRIPTION
This module provides a simple container for storing details about a callback to be invoked at a later date. It is used when registering to receive events from the Net::DBus::Reactor class. NB use of this module in application code is no longer neccessary and it remains purely for backwards compatability. Instead you can simply pass a subroutine code reference in any place where a callback is desired. METHODS
my $cb = Net::DBus::Callback->new(method => $name, [args => @args]) Creates a new callback object, for invoking a plain old function. The "method" parameter should be the fully qualified function name to invoke, including the package name. The optional "args" parameter is an array reference of parameters to be pass to the callback, in addition to those passed into the "invoke" method. my $cb = Net::DBus::Callback->new(object => $object, method => $name, [args => @args]) Creates a new callback object, for invoking a method on an object. The "method" parameter should be the name of the method to invoke, while the "object" parameter should be a blessed object on which the method will be invoked. The optional "args" parameter is an array reference of parameters to be pass to the callback, in addition to those passed into the "invoke" method. $cb->invoke(@args) Invokes the callback. The argument list passed to the callback is a combination of the arguments supplied in the callback constructor, followed by the arguments supplied in the "invoke" method. AUTHOR
Daniel P. Berrange. COPYRIGHT
Copyright (C) 2004-2011 Daniel P. Berrange SEE ALSO
Net::DBus::Reactor perl v5.14.2 2011-06-30 Net::DBus::Callback(3pm)
Man Page