Example of passing custom data:
<?php
// Create and start timer firing after 2 seconds with custom data
$w1 = new EvTimer(2, 0, function ($w) {
echo "Custom data: $w->data\n";
echo "2 seconds elapsed\n";
}, 'abcd');
Ev::run();
?>
Running this will print out:
Custom data: abcd
2 seconds elapsed
Note that 'data' is a public property of the event EvWatcher class.