<?php
# create the worker
$worker = new GearmanWorker();
# add the default job server (localhost)
$worker->addServer();
# add the reverse function
$worker->addFunction("reverse", "my_reverse_function");
# start te worker listening for job submissions
while ($worker->work());
function my_reverse_function($job)
{
return strrev($job->workload());
}
?>