Skip to content

Commit 9b49a6b

Browse files
committed
Revert "Remove the various ways to set a callable"
This reverts commit ddbf7ba.
1 parent 912f2eb commit 9b49a6b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

reference/funchand/functions/register-tick-function.xml

+11
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,19 @@ function my_function($param) {
6464
echo "Tick callback function called with param: $param\n";
6565
}
6666
67+
// Class with a method
68+
class my_class {
69+
public function my_method($param) {
70+
echo "Tick callback method called with param: $param\n";
71+
}
72+
}
73+
6774
// using a function as the callback
6875
register_tick_function('my_function', true);
76+
77+
// using an object->method
78+
$object = new my_class();
79+
register_tick_function(array($object, 'my_method'), true);
6980
?>
7081
]]>
7182
</programlisting>

0 commit comments

Comments
 (0)