php / php/doc-extensions

GearmanWorker::addFunction example throws warning

Open
#37 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
XML
Stars
2
Forks
6
Avg merge
1d 14h
Merged PRs (30d)
5

Description

When running the example from the GearmanWorker::addFunction documentation, the following warning shows up:

PHP Warning:  reverse_cb(): Argument php/doc-en#2 ($count) must be passed by reference, value given in worker.php on line 16

Seems like the $context is not passed by reference.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked GearmanWorker::addFunction documentation example and reproduce the warning shown in the issue. Check how the example passes $context to reverse_cb; done means the documented example runs without the by-reference warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.