Descrierea

Adds a task to be run in parallel with other tasks. Call this method for all the tasks
to be run in parallel, then call GearmanClient::runTasks() to
perform the work. Note that enough workers need to be available for the tasks to all
run in parallel.

As of PHP 5.3.0, you will get a warning saying that "call-time pass-by-reference" is deprecated when you use & in $client->addTask(..., ..., &$results, ...);. And as of PHP 5.4.0, call-time pass-by-reference was removed, so using it will raise a fatal error.

So that means that when you call addTask with a context parameter as in the example above like this:

<?php# Add some tasks for a placeholder of where to put the results$results = array();$client->addTask("reverse", "Hello World!", &$results, "t1");?>

You get this "call-time pass-by-reference" warning (or error). This can be avoided and still result in functional code by changing the context variable to be an object so that it is passed by reference like this: